基于,为了可读性,JavaScript使用科学记数法来显示非常大的数字(大于或等于1021的绝对值)。例如,写入语句
document.write(1000000000000000000000000);
会产生输出
1e24
我可以避免显示科学记数法吗?
Thanks
It’s not for readability. If an integer is larger than 253 (9007199254740992), then JavaScript cannot guarantee its exact storage. In your case the number is actually 999999999999999983222784.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)