There's an excellent technical paper about floating-point arithmetic. It explains why calculations done on a computer can never be perfect. http://docs.sun.com/source/806-3568/ncg_goldberg.html