115

从0.1+0.2=0.30000000000000004再看JS中的Number类型

 6 years ago
source link: https://juejin.im/post/5a6fce10f265da3e261c3c71
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
写在前面 今天在看《JavaScript高级程序设计》的时候,注意到书中特意提到了0.1+0.2=0.30000000000000004这样一个浮点数计算错误的问题,觉得很有意思。平时在工作中对于浮点数了解地并不多,正好最近小组同学也遇到了这个问题,准备来总结

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK