js-on-sx: js-num-from-string uses string->number for exp-form
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s
Was computing m * pow(10, e) for "1.2345e-3" forms; floating-point
multiplication introduced rounding (Number(".12345e-3") -
0.00012345 == 2.7e-20). The SX string->number primitive parses the
whole literal in one IEEE round, matching JS literal parsing. Falls
back to manual m * pow(10, e) only when string->number returns nil.
built-ins/Number: 42/50 → 43/50. conformance.sh: 148/148.
This commit is contained in:
@@ -1123,23 +1123,28 @@
|
||||
(if
|
||||
(>= esplit 0)
|
||||
(let
|
||||
((mant (js-string-slice trimmed 0 esplit))
|
||||
(expstr
|
||||
(js-string-slice
|
||||
trimmed
|
||||
(+ esplit 1)
|
||||
(len trimmed))))
|
||||
(let
|
||||
((m (js-parse-decimal mant 0 0 1 false 0))
|
||||
(e
|
||||
(js-parse-decimal
|
||||
expstr
|
||||
0
|
||||
0
|
||||
1
|
||||
false
|
||||
0)))
|
||||
(* m (pow 10 e))))
|
||||
((parsed (string->number trimmed)))
|
||||
(if
|
||||
(= parsed nil)
|
||||
(let
|
||||
((mant (js-string-slice trimmed 0 esplit))
|
||||
(expstr
|
||||
(js-string-slice
|
||||
trimmed
|
||||
(+ esplit 1)
|
||||
(len trimmed))))
|
||||
(let
|
||||
((m (js-parse-decimal mant 0 0 1 false 0))
|
||||
(e
|
||||
(js-parse-decimal
|
||||
expstr
|
||||
0
|
||||
0
|
||||
1
|
||||
false
|
||||
0)))
|
||||
(* m (pow 10 e))))
|
||||
parsed))
|
||||
(js-parse-decimal
|
||||
trimmed
|
||||
0
|
||||
|
||||
@@ -56,6 +56,6 @@
|
||||
]
|
||||
],
|
||||
"pinned_commit": "d5e73fc8d2c663554fb72e2380a8c2bc1a318a33",
|
||||
"elapsed_seconds": 273.6,
|
||||
"elapsed_seconds": 152.5,
|
||||
"workers": 1
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
# test262 scoreboard
|
||||
|
||||
Pinned commit: `d5e73fc8d2c663554fb72e2380a8c2bc1a318a33`
|
||||
Wall time: 273.6s
|
||||
Wall time: 152.5s
|
||||
|
||||
**Total:** 78/99 runnable passed (78.8%). Raw: pass=78 fail=15 skip=1 timeout=6 total=100.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user