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.

posted @ 2011-11-25 07:22  allenbackpacker  阅读(121)  评论(0编辑  收藏  举报