This is about string representation; I've explained this in other threads. JS has one number format, but it *pretends* to make the distinction when converting to string, by notating floats with exact integer values differently (without a decimal point, unlike other languages).
You deleted a tweet about 4611686018427388000 converting to the same number as BigInt. I can't test it because Chrome is using an older version of the draft that forbids that, but nope. Converting what JS calls 4611686018427388000 to BigInt would yield 4611686018427387904n.
-
-
This is also the case in Python and every other language with IEEE 754 64-bit floats: >>> int(4611686018427388000.0) 4611686018427387904 Because 4611686018427388000 is *not* an exact float64 value. 4611686018427387904 is.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This Tweet is unavailable.
-
Yes, I linked to that algorithm before in other threads. That algorithm is the problem, and it's stupid and nonsensical. The threshold to break out into e-notation (step 9) should be earlier, instead of padding with trailing zeroes (step 6). No other language does this.
- Show replies
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.