10.0 * 0.1 =?= 1
utzoo!henry
utzoo!henry
Tue May 4 15:44:18 AEST 1982
A friend of mine once made a very true comment: "floating point is an
analog box anyway". To my mind, the only thing one is justified in
assuming about floating-point arithmetic is that the result is somewhere
near what it should be. Assuming that 0.5 * 2 == 1 is just as foolish
as assuming 10.0 * 0.1 == 1; there will always be some machine where
it's not, for one reason or another. Pray for machines which can support
efficient interval arithmetic.
This is not to dispute that {x *= y} != {x = x * y} is wrong code.
Henry Spencer
decvax!utzoo!henry
More information about the Comp.unix.wizards
mailing list