Added hyp function.

This commit is contained in:
PaddiM8 2020-05-30 18:01:45 +02:00
parent 0dac28bb42
commit dc59d7cac2

View File

@ -54,6 +54,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),
"hyp" => BinaryFuncInfo(hyp, Other),
"log" => BinaryFuncInfo(logx, Other),
};
@ -219,6 +220,10 @@ mod funcs {
x.fract()
}
pub fn hyp(x: f64, y: f64) -> f64 {
x.hypot(y)
}
pub fn log(x: f64) -> f64 {
x.log(10f64)
}