mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-02-12 14:39:15 +01: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)?)
|
||||
} else {
|
||||
let (real, _, unit) = as_number_or_return!(x);
|
||||
|
||||
Ok(KalkValue::Number(real.signum(), float!(0), unit))
|
||||
if real == 0f64 {
|
||||
Ok(KalkValue::Number(float!(0), float!(0), unit))
|
||||
} else {
|
||||
Ok(KalkValue::Number(real.signum(), float!(0), unit))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user