aboutsummaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorBarinzaya <barinzaya@gmail.com>2025-04-07 13:38:10 -0400
committerBarinzaya <barinzaya@gmail.com>2025-04-07 13:38:10 -0400
commitbffa0eaa58f837d0f1a4c1617c53440ea8ba839a (patch)
tree39ae5927a871f645c775461eff6312d8e34e91e6 /core/math
parent2b26c0b39ee851509eaa29eb074fcfd0df242201 (diff)
Fixed math.nextafter procs skipping from 0 to 1.
Diffstat (limited to 'core/math')
-rw-r--r--core/math/math.odin6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/math/math.odin b/core/math/math.odin
index 934842318..c8df8dbab 100644
--- a/core/math/math.odin
+++ b/core/math/math.odin
@@ -2296,7 +2296,7 @@ nextafter_f16 :: proc "contextless" (x, y: f16) -> (r: f16) {
case x == y:
r = x
case x == 0:
- r = copy_sign_f16(1, y)
+ r = copy_sign_f16(transmute(f16)u16(1), y)
case (y > x) == (x > 0):
r = transmute(f16)(transmute(u16)x + 1)
case:
@@ -2312,7 +2312,7 @@ nextafter_f32 :: proc "contextless" (x, y: f32) -> (r: f32) {
case x == y:
r = x
case x == 0:
- r = copy_sign_f32(1, y)
+ r = copy_sign_f32(transmute(f32)u32(1), y)
case (y > x) == (x > 0):
r = transmute(f32)(transmute(u32)x + 1)
case:
@@ -2328,7 +2328,7 @@ nextafter_f64 :: proc "contextless" (x, y: f64) -> (r: f64) {
case x == y:
r = x
case x == 0:
- r = copy_sign_f64(1, y)
+ r = copy_sign_f64(transmute(f64)u64(1), y)
case (y > x) == (x > 0):
r = transmute(f64)(transmute(u64)x + 1)
case: