Why does 230/100*100 not return 230? [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Is JavaScript’s Math broken? In Javascript, I cannot figure out why 230/100*100 returns 229.99999999999997 , while 240/100*100 returns 240. This also applies to 460, 920 and so on... Is there any solution? 回答1: In JavaScript all numeric values are stored as IEEE 754 64-bit floating-point values (also known as double in many languages). This representation has only finite precision (so not all numbers can be