in reply to 5.35 != 5.35

Phew! It'd been almost a week gone by without seeing someone baffled by the basic fact that IEEE floats aren't exact representations. I was starting to worry there for a bit.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^2: 5.35 != 5.35
by amarquis (Curate) on Feb 21, 2008 at 23:35 UTC

    To be fair, the first time you encounter this error it is hard to find the issue unless you already know a bit about floating point numbers. The things you likely attribute it to and then search for aren't going to give you the answer (like in this case, where the suspected error was a type-mismatch).

    (I know you weren't mocking him, I just got started thinking on how hard this particular problem is for novices to diagnose if they don't already know the answer.)