js-on-sx: js-neg preserves IEEE-754 negative zero
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s

JS -0 was returning rational integer 0; the (- 0 x) form loses the
sign-of-zero. Switched js-neg to (* -1 (exact->inexact (js-to-number a))),
which produces a float and preserves -0.0. Now 1/(-0) === -Infinity
and Math.asinh(-0) preserves the sign as required by the spec.
built-ins/Math: 41/45 → 42/45. conformance.sh: 148/148.
This commit is contained in:
2026-05-07 19:11:30 +00:00
parent 5f97e78d5f
commit 11612a511b
4 changed files with 5 additions and 3 deletions

View File

@@ -1453,7 +1453,7 @@
(define js-pow (fn (a b) (pow (js-to-number a) (js-to-number b))))
(define js-neg (fn (a) (- 0 (js-to-number a))))
(define js-neg (fn (a) (* -1 (exact->inexact (js-to-number a)))))
(define js-pos (fn (a) (js-to-number a)))