Dart double division precision
问题 What is the correct way to perform this operation? 399.9 / 100 What I would expect to see is 3.999 but the result is 3.9989999999999997 回答1: The result you see is correct , it's just not what you want. Doubles are not precise values. The double you get by writing 399.9 is actually the precise value. 399.8999999999999772626324556767940521240234375 That's the closest available double to the exact value 399.9. Any other double is at least as far away from 399.9 as that. Then you divide by 100.