A very good test case from Martin

While programming, need to become aware of causes for overflow and roundoff errors.
Martin mentioned below arithmetic. I think it’s a very good test case for testing in future.
1.2345 * 5.123 / 5.123 = 1.234499999 ?
Also, Martin mentioned that before when they paid the goods with tax, sometimes maybe let you pay 20.199999 CHF in the bill. That’s because of roundoff error.

原文地址:https://www.cnblogs.com/backpacker/p/2262549.html