Added binary log function.

This commit is contained in:
PaddiM8 2020-05-29 22:04:40 +02:00
parent 34364dd40e
commit aacb787bce

View File

@ -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()
}