From aacb787bce109786f71cbdd5f379eb8209f082e3 Mon Sep 17 00:00:00 2001 From: PaddiM8 Date: Fri, 29 May 2020 22:04:40 +0200 Subject: [PATCH] Added binary log function. --- src/prelude.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/prelude.rs b/src/prelude.rs index 810f582..110c80e 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -55,6 +55,7 @@ pub const UNARY_FUNCS: phf::Map<&'static str, UnaryFuncInfo> = phf::phf_map! { pub const BINARY_FUNCS: phf::Map<&'static str, BinaryFuncInfo> = phf::phf_map! { "max" => BinaryFuncInfo(max, Other), "min" => BinaryFuncInfo(min, Other), + "log" => BinaryFuncInfo(logx, Other), }; enum FuncType { @@ -223,6 +224,10 @@ mod funcs { x.log(10f64) } + pub fn logx(x: f64, y: f64) -> f64 { + x.log(y) + } + pub fn ln(x: f64) -> f64 { x.ln() }