summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/src/compute/calc.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/library/src/compute/calc.rs b/library/src/compute/calc.rs
index 25df817d..7fcc6131 100644
--- a/library/src/compute/calc.rs
+++ b/library/src/compute/calc.rs
@@ -366,7 +366,13 @@ pub fn log(
#[default(10.0)]
base: f64,
) -> Value {
- Value::Float(value.log(base))
+ Value::Float(if base == 2.0 {
+ value.log2()
+ } else if base == 10.0 {
+ value.log10()
+ } else {
+ value.log(base)
+ })
}
/// Round a number down to the nearest integer.