Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: narby
Yup. But airplanes can't navigate to "NAN". I had forgotten that IEEE floating point has an infinite representation.

Of course not. But the point is for the program to be able to catch the NaN before applying it, and do something appropriate instead.

212 posted on 12/08/2006 2:29:38 PM PST by Erasmus (Go to Sebastopol and Crimea River.)
[ Post Reply | Private Reply | To 203 | View Replies ]


To: Erasmus
But the point is for the program to be able to catch the NaN before applying it, and do something appropriate instead.

Doing something appropriate is not crashing and instead giving me a useable number that's effectively rounded to infinity. It's wasteful to make the code do it, and it causes issues then the programmer forgets.

The value 0.1 cannot be represented in floating point, and this doesn't cause anyone any greef when I use a rounded value instead. I'm of the opinion that computer hardware should do the same for divide by zero exceptions, and return a rounded value of infinity that operates in succeding calculations. Returning a NAN merely trashes everything afterward, and it's not a useable option.

226 posted on 12/08/2006 2:41:29 PM PST by narby
[ Post Reply | Private Reply | To 212 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson