diff options
author | NerdyPepper <[email protected]> | 2019-03-22 11:27:33 +0000 |
---|---|---|
committer | NerdyPepper <[email protected]> | 2019-03-22 11:27:33 +0000 |
commit | 894cbbca05c860c0eaef2fdc20c63f9012167cc1 (patch) | |
tree | 963521e665ffa997c30d1b7f1c2f68f4c5b35dae /src/lex | |
parent | 899d31b79ebe310ef39f4b1a0ccfc6c5cd4129fb (diff) |
add floor and ceil fn
Diffstat (limited to 'src/lex')
-rw-r--r-- | src/lex/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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<Vec<Token>, String> { | |||
100 | "ln" => result.push(Function::token_from_fn("ln".into(), |x| x.ln())), | 100 | "ln" => result.push(Function::token_from_fn("ln".into(), |x| x.ln())), |
101 | "log" => result.push(Function::token_from_fn("log".into(), |x| x.log10())), | 101 | "log" => result.push(Function::token_from_fn("log".into(), |x| x.log10())), |
102 | "sqrt" => result.push(Function::token_from_fn("sqrt".into(), |x| x.sqrt())), | 102 | "sqrt" => result.push(Function::token_from_fn("sqrt".into(), |x| x.sqrt())), |
103 | "floor" => result.push(Function::token_from_fn("floor".into(), |x| x.floor())), | ||
104 | "ceil" => result.push(Function::token_from_fn("ceil".into(), |x| x.ceil())), | ||
103 | _ => return Err(format!("Unexpected function {}", funct)) | 105 | _ => return Err(format!("Unexpected function {}", funct)) |
104 | } | 106 | } |
105 | char_vec.clear(); | 107 | char_vec.clear(); |