hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 51067d58526abd950478d1e632893fbda63918d5
parent c4b2679f5277d3697687b0910e23c08e76e2e9a4
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Sun, 30 Jan 2022 20:32:43 +0000

math::nearbyint{32,64}: fix a few constants

Caught by the flexible constant overhaul, but this is also more correct.

Signed-off-by: Eyal Sawady <ecs@d2evs.net>

Diffstat:
Mmath/floats.ha | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/math/floats.ha b/math/floats.ha @@ -871,7 +871,7 @@ fn nearbyintf32(x: f32) f32 = { return x; }; let s = n >> 31; - let y = if (s != 0.0) + let y = if (s != 0) x - 1.0 / F32_EPS + 1.0 / F32_EPS else x + 1.0 / F32_EPS - 1.0 / F32_EPS; @@ -890,7 +890,7 @@ fn nearbyintf64(x: f64) f64 = { return x; }; let s = n >> 63; - let y = if (s != 0.0) + let y = if (s != 0) x - 1.0 / F64_EPS + 1.0 / F64_EPS else x + 1.0 / F64_EPS - 1.0 / F64_EPS;