aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2019-03-27 08:42:51 +0000
committerNerdyPepper <[email protected]>2019-03-27 08:42:51 +0000
commit6d390a03367544fb7a824ae7825ed333903f255f (patch)
treeb4ceb2bd7148f89e6d1bfd255fdb5f8da295fca8
parent42476911733ae8baa7baac2ce31b672ef525ec5f (diff)
add rad(), deg() and abs() functions
-rw-r--r--src/lex/mod.rs3
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}