New issue
Advanced search Search tips

Issue 907971 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 23
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Long number calculate error on DevTools(F12) panel

Reported by tliang1...@gmail.com, Nov 23

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36

Steps to reproduce the problem:
1. open DevTools Console
2. input 187214665202985356, enter
3. output: 187214665202985340

ps: it also error on DevTools Network Preview panel for json response

What is the expected behavior?

What went wrong?
calculate error

Did this work before? N/A 

Chrome version: 70.0.3538.102  Channel: stable
OS Version: OS X 10.13.1
Flash Version:
 
QQ20181123-134639@2x.png
45.2 KB View Download
Your number has more than 16 digits in the mantissa part,
which is the limit of JavaScript numbers in IEEE 754 format.

While technically this is not a bug, but behaviorally it appears as one.
It might make sense for Chrome to display such numbers in exponential notation:
1.872146652029853e17

If you want more precision, you can use BigInt in new Chrome by adding "n" suffix:
187214665202985356n
Status: WontFix (was: Unconfirmed)
The toString functionality is also covered in the ecmascript spec and Chrome is compliant so I don't think we want to change how exponential notation changes.

Sign in to add a comment