Skip to content
Advertisement

Tag: floating-point

Why is 5726718050568503296 truncated in JS

As per the standard ES implements numbers as IEEE754 doubles. And per https://www.binaryconvert.com/result_double.html?decimal=053055050054055049056048053048053054056053048051050057054 and other programming languages https://play.golang.org/p/5QyT7iPHNim it looks like the 5726718050568503296 value can be represented exactly without losing precision. Why it loses 3 significant digits in JS (reproduced in latest stable google chrome and firefox) This question was triggered initially from the replicate javascript unsafe numbers in golang

Advertisement