How can I print 413284921265094656?

markzzz
alert(413284921265094656 + "");

but it prints 413284921265094660, even if I "convert" it in string.

TypeIA

Perhaps I don't understand the question, but...

alert("413284921265094656")

The interpreter is trying to store 413284921265094656 as a double-precision floating point number, but the number exceeds the precision limit, so the least significant bits are being lost. You can't store a number with that much precision (roughly speaking, that many digits or "significant figures") in JavaScript without use of a big-int library.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related