41

JS中如何理解浮点数?

 5 years ago
source link: https://juejin.im/post/5c22fcbe6fb9a049ba419d4c
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 开发中,都有遇到过浮点数运算精度误差的问题,比如 console.log(0.1+0.2===0.3)// false。在 JavaScript 中,所有的数字包括整数和小数都是用 Number 类

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK