From 894cbbca05c860c0eaef2fdc20c63f9012167cc1 Mon Sep 17 00:00:00 2001 From: NerdyPepper Date: Fri, 22 Mar 2019 16:57:33 +0530 Subject: add floor and ceil fn --- src/lex/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lex/mod.rs') diff --git a/src/lex/mod.rs b/src/lex/mod.rs index af5ff06..7fd5e33 100644 --- a/src/lex/mod.rs +++ b/src/lex/mod.rs @@ -100,6 +100,8 @@ pub fn lexer(input: &str) -> Result, String> { "ln" => result.push(Function::token_from_fn("ln".into(), |x| x.ln())), "log" => result.push(Function::token_from_fn("log".into(), |x| x.log10())), "sqrt" => result.push(Function::token_from_fn("sqrt".into(), |x| x.sqrt())), + "floor" => result.push(Function::token_from_fn("floor".into(), |x| x.floor())), + "ceil" => result.push(Function::token_from_fn("ceil".into(), |x| x.ceil())), _ => return Err(format!("Unexpected function {}", funct)) } char_vec.clear(); -- cgit v1.2.3