You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect result when logging subnormal floating-point number to console. #17500
Platform: Linux d0cc2382da37 4.4.0-101-generic 124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 Linux
Subsystem: console
Logging a subnormal floating-point number to console prints -0 instead of the correct number when passed as first argument to console.log. It prints the correct number if passed in as the second argument.
Additional info:
I tested this code sample and can confirm incorrect output for versions 8.9.1, 8.9.2, and 9.x.
The same code sample produces the expected output in version 8.3.
changed the title [-]Incorrect result when logging subnormal floating point number to console.[/-][+]Incorrect result when logging subnormal floating-point number to console.[/+]on Dec 6, 2017
Activity
[-]Incorrect result when logging subnormal floating point number to console.[/-][+]Incorrect result when logging subnormal floating-point number to console.[/+]ealmansi commentedon Dec 6, 2017
cc @jpdjere
vsemozhetbyt commentedon Dec 6, 2017
FWIW, the output in the Chrome and Node.js REPL differ here:
Node.js canary with V8 6.5:
Google Chrome 65.0.3286.0:
devsnek commentedon Dec 6, 2017
this error comes from formatNumber in util.js:
value === 0 && -1 / value === -Infinityshould fix this:BridgeAR commentedon Dec 16, 2017
This already got fixed by #17507
Closing