js-on-sx: js-div coerces divisor to inexact
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 55s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 55s
(js-div 1 0) with rational integer literals throws "rational: division by zero" instead of producing Infinity. Wrapped the divisor in (exact->inexact ...) so integer-by-zero now returns inf/-inf/nan matching JS semantics. Hit by the harness's _isSameValue +0/-0 check which calls (js-div 1 a) on JS literal arguments. built-ins/Number: 37/50 → 41/50. built-ins/String: 77/99. conformance.sh: 148/148.
This commit is contained in:
@@ -1436,7 +1436,9 @@
|
||||
|
||||
(define js-mul (fn (a b) (* (js-to-number a) (js-to-number b))))
|
||||
|
||||
(define js-div (fn (a b) (/ (js-to-number a) (js-to-number b))))
|
||||
(define
|
||||
js-div
|
||||
(fn (a b) (/ (js-to-number a) (exact->inexact (js-to-number b)))))
|
||||
|
||||
(define js-mod (fn (a b) (mod (js-to-number a) (js-to-number b))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user