mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-28 13:42:18 +02:00
Make sgn(0) equal to 0, closing #106
This commit is contained in:
parent
cca37525c8
commit
5303ea6652
@ -937,8 +937,11 @@ pub mod funcs {
|
|||||||
x.clone().div_without_unit(&abs(x)?)
|
x.clone().div_without_unit(&abs(x)?)
|
||||||
} else {
|
} else {
|
||||||
let (real, _, unit) = as_number_or_return!(x);
|
let (real, _, unit) = as_number_or_return!(x);
|
||||||
|
if real == 0f64 {
|
||||||
Ok(KalkValue::Number(real.signum(), float!(0), unit))
|
Ok(KalkValue::Number(float!(0), float!(0), unit))
|
||||||
|
} else {
|
||||||
|
Ok(KalkValue::Number(real.signum(), float!(0), unit))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user