[英]Javascript parseInt with radix 16 issue
The alert statement alert(parseInt("0x00C02700010004E9",16));
警告语句
alert(parseInt("0x00C02700010004E9",16));
incorrectly displays 54086076498707690 instead of the correct value 54086076498707689. Please notice the last two digits!! 错误地显示54086076498707690而不是正确的值54086076498707689.请注意最后两位数!!
Could anyone shed some light on what am I doing wrong? 有人能说清楚我做错了什么吗?
Yes! 是! Javascript is not accurate to that many digits!
Javascript对于那么多数字来说并不准确! See: Large numbers erroneously rounded in Javascript
请参阅: Javascript错误地舍入大数字
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.