aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2025-02-06 21:06:25 +0100
committerLaytan Laats <laytanlaats@hotmail.com>2025-02-06 21:19:54 +0100
commitde83ad2a251ec126a02378b83e4cae5b853e34ac (patch)
treee4117c95187ea06cfb41430012f79974ad63332c /src/check_builtin.cpp
parentb1068c7f2e71552b0d49b89945c7eabce4b5f878 (diff)
apply abs fix to constant system too
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index ea902387b..bf4c004d7 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -3488,9 +3488,12 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
case ExactValue_Integer:
mp_abs(&operand->value.value_integer, &operand->value.value_integer);
break;
- case ExactValue_Float:
- operand->value.value_float = gb_abs(operand->value.value_float);
+ case ExactValue_Float: {
+ u64 abs = bit_cast<u64>(operand->value.value_float);
+ abs &= 0x7FFFFFFFFFFFFFFF;
+ operand->value.value_float = bit_cast<f64>(abs);
break;
+ }
case ExactValue_Complex: {
f64 r = operand->value.value_complex->real;
f64 i = operand->value.value_complex->imag;