Changed nth_sqrt to nth_root.

This commit is contained in:
PaddiM8 2020-06-18 16:20:52 +02:00
parent 07e34c6bbb
commit 3259e78597

View File

@ -63,7 +63,7 @@ pub const BINARY_FUNCS: phf::Map<&'static str, BinaryFuncInfo> = phf::phf_map! {
"min" => BinaryFuncInfo(min, Other), "min" => BinaryFuncInfo(min, Other),
"hyp" => BinaryFuncInfo(hyp, Other), "hyp" => BinaryFuncInfo(hyp, Other),
"log" => BinaryFuncInfo(logx, Other), "log" => BinaryFuncInfo(logx, Other),
"sqrt" => BinaryFuncInfo(nth_sqrt, Other), "root" => BinaryFuncInfo(nth_root, Other),
}; };
enum FuncType { enum FuncType {
@ -317,7 +317,7 @@ mod funcs {
x.sqrt() x.sqrt()
} }
pub fn nth_sqrt(x: Float, n: Float) -> Float { pub fn nth_root(x: Float, n: Float) -> Float {
x.pow(Float::with_val(1, 1) / n) x.pow(Float::with_val(1, 1) / n)
} }