开发者

Unexpected results in Firebug

Unexpected results in Firebug console. Why in this operation: 1.7E16+2 the last number is 2 and in 1.7E16+3 operation the last n开发者_如何学编程umber is 4 :D This is a JavaScript Bug?

Firebug unexpected results


This is not unexpected. This is standard floating point behavior.

You really should read 'What Every Computer Scientist Should Know About Floating-Point Arithmetic'.

If that material is too complicated, and it most definitely is, http://floating-point-gui.de is a very concise alternative.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜