aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Bosch <[email protected]>2021-12-26 12:53:22 +0000
committerMaximilian Bosch <[email protected]>2021-12-30 17:06:49 +0000
commit27c5539c0aa8e7df2947d9addbab90b2df8c3a3d (patch)
tree1890d75cfbf3cd7921fa01b0b27a137050e273da
parent3f52f6f2ce8408350fcdc180d416e63dd627d93f (diff)
Add `exp(x)` function which evaluates to `e^x`
Quite useful when doing analysis at University, also preferable over `e^x` because it's way nicer to write `exp(arbitrary expr)` rather than `e^(arbitrary expr)`.
-rw-r--r--src/lex.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lex.rs b/src/lex.rs
index 76f61a0..4bdd7b6 100644
--- a/src/lex.rs
+++ b/src/lex.rs
@@ -101,6 +101,7 @@ lazy_static! {
101 m.insert("acsc", Function::token_from_fn("acsc".into(), |x| (1./x).asin())); 101 m.insert("acsc", Function::token_from_fn("acsc".into(), |x| (1./x).asin()));
102 m.insert("asec", Function::token_from_fn("asec".into(), |x| (1./x).acos())); 102 m.insert("asec", Function::token_from_fn("asec".into(), |x| (1./x).acos()));
103 m.insert("acot", Function::token_from_fn("acot".into(), |x| (1./x).atan())); 103 m.insert("acot", Function::token_from_fn("acot".into(), |x| (1./x).atan()));
104 m.insert("exp", Function::token_from_fn("exp".into(), |x| x.exp()));
104 // single arg function s can be added here 105 // single arg function s can be added here
105 m 106 m
106 }; 107 };