If you’ve ever been surprised by a program that printed some cryptic letter combination when you were expecting a number, you’ve run into an arithmetic exception. This article explains what caused your problem and what you may be able to do to fix it.
Here’s a teaser. If
x is of type
double, does the expression
(x == x) always evaluate to true? Are you certain?