From 27c5539c0aa8e7df2947d9addbab90b2df8c3a3d Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 26 Dec 2021 13:53:22 +0100 Subject: 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)`. --- src/lex.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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! { m.insert("acsc", Function::token_from_fn("acsc".into(), |x| (1./x).asin())); m.insert("asec", Function::token_from_fn("asec".into(), |x| (1./x).acos())); m.insert("acot", Function::token_from_fn("acot".into(), |x| (1./x).atan())); + m.insert("exp", Function::token_from_fn("exp".into(), |x| x.exp())); // single arg function s can be added here m }; -- cgit v1.2.3