Dec. 7th, 2006
I'm not a math genius, but one day I would like to play one on TV. I just read an article on BBC's website about Dr. James Anderson and his new theory that "solves" an extremely important problem.
"Imagine you're landing on an aeroplane and the automatic pilot's working," he suggests. "If it divides by zero and the computer stops working - you're in big trouble. If your heart pacemaker divides by zero, you're dead."
That's why the IEEE specification for floating point math includes values like NaN (not a number), +Inf and -Inf. You can trap undefined operations such as divide by zero and handle them correctly. Any programmer worth half his pay knows how to handle the exception or to check for zero in the denominator before dividing.
My favorite comment that puts it into perspective is from Kurt Fitzner:
The "problem" of a computer with divide-by-zero errors is not a problem, it's a feature. It's not something you need to or even want to fix. You could easily design a computer that doesn't have an error in that situation if that's what you want. Replacing the error condition with a new symbol accomplishes nothing. The program still has to deal with the issue in order to present a real-world result to the user. A divide-by-zero error is the way programs do that.
What are they teaching in schools these days?