开发者

Unexpected results in Firebug

开发者 https://www.devze.com 2023-01-28 11:20 出处:网络
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?

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

精彩评论

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