diff options
author | NerdyPepper <[email protected]> | 2019-03-27 08:42:51 +0000 |
---|---|---|
committer | NerdyPepper <[email protected]> | 2019-03-27 08:42:51 +0000 |
commit | 6d390a03367544fb7a824ae7825ed333903f255f (patch) | |
tree | b4ceb2bd7148f89e6d1bfd255fdb5f8da295fca8 /src/lex | |
parent | 42476911733ae8baa7baac2ce31b672ef525ec5f (diff) |
add rad(), deg() and abs() functions
Diffstat (limited to 'src/lex')
-rw-r--r-- | src/lex/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lex/mod.rs b/src/lex/mod.rs index e12f327..8348e72 100644 --- a/src/lex/mod.rs +++ b/src/lex/mod.rs | |||
@@ -87,6 +87,9 @@ fn get_functions() -> HashMap<&'static str, Token> { | |||
87 | ("sqrt", Function::token_from_fn("sqrt".into(), |x| x.sqrt())), | 87 | ("sqrt", Function::token_from_fn("sqrt".into(), |x| x.sqrt())), |
88 | ("ceil", Function::token_from_fn("ceil".into(), |x| x.ceil())), | 88 | ("ceil", Function::token_from_fn("ceil".into(), |x| x.ceil())), |
89 | ("floor", Function::token_from_fn("floor".into(), |x| x.floor())), | 89 | ("floor", Function::token_from_fn("floor".into(), |x| x.floor())), |
90 | ("rad", Function::token_from_fn("rad".into(), |x| x.to_radians())), | ||
91 | ("deg", Function::token_from_fn("deg".into(), |x| x.to_degrees())), | ||
92 | ("abs", Function::token_from_fn("abs".into(), |x| x.abs())), | ||
90 | // single arg functions can be added here | 93 | // single arg functions can be added here |
91 | ].iter().cloned().collect(); | 94 | ].iter().cloned().collect(); |
92 | } | 95 | } |