From 66e276a8a218e0e743ee629197a80e11e5241410 Mon Sep 17 00:00:00 2001 From: Larry Frieson Date: Tue, 27 Feb 2024 18:29:30 -0800 Subject: [PATCH] Fix number.sign() in cnex --- exec/cnex/exclude.txt | 1 - exec/cnex/number.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/exec/cnex/exclude.txt b/exec/cnex/exclude.txt index 63e20f08c..e254dbbb7 100644 --- a/exec/cnex/exclude.txt +++ b/exec/cnex/exclude.txt @@ -6,7 +6,6 @@ gc1.neon # Object Count gc2.neon # Object Count gc3.neon # Object Count gc-two-pointers.neon # garbage collection -math-test.neon # math.powmod() extsample-test.neon # cell_set_pointer http-test.neon # string$split diff --git a/exec/cnex/number.c b/exec/cnex/number.c index 858028d93..b66603657 100644 --- a/exec/cnex/number.c +++ b/exec/cnex/number.c @@ -328,6 +328,9 @@ Number number_abs(Number x) Number number_sign(Number x) { + if (bid128_isZero(x)) { + return bid128_from_uint32(0); + } return bid128_copySign(bid128_from_uint32(1), x); }