这是我面临的一个奇怪问题.当我将一些大数字传递给JS函数(自定义或内置)时,该值会自动增加1.例如,请参阅:
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display an alert box.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
alert(10466511635124471);
}
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在我看到的警报中10466511635124472,而不是10466511635124471.有人可以解释这种行为吗?
我在FF 17.0.10和Chrome 12.0.742.122以及IE 8中检查了这个.