Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
parseFloat("-999999999999999.9991") returns -1000000000000000
以及调试时
(-1000000000000000 == -999999999999999.999)条件为真。
(-1000000000000000 == -999999999999999.999)
浮点数据类型的操作精度有限,并且在像您的情况一样舍入数字时经常会引入错误。