FIX: Issues with SIGN and EXP

Fixes #563
This commit is contained in:
Nicolás Hatcher
2025-11-19 02:31:41 +01:00
committed by Nicolás Hatcher Andrés
parent 8e15c623dd
commit 7676efca44
4 changed files with 41 additions and 40 deletions

View File

@@ -1336,7 +1336,13 @@ impl Model {
}
Ok(acc)
});
single_number_fn!(fn_sign, |f| Ok(f64::signum(f)));
single_number_fn!(fn_sign, |f| {
if f == 0.0 {
Ok(0.0)
} else {
Ok(f64::signum(f))
}
});
single_number_fn!(fn_degrees, |f| Ok(f * (180.0 / PI)));
single_number_fn!(fn_radians, |f| Ok(f * (PI / 180.0)));
single_number_fn!(fn_odd, |f| {