Not A Number - quick fix
Posted on 2001-09-03
I am using GNU C++ and Borland Builder C++
I have written a program, and discovered a fault - However I do not have the time to rewrite the whole program from the ground up as it will take too long. I wish to patch the code instead.
My program sometimes returns NaN becasue it has exceeded a boundary, my idea is to use a if statement to check to see if the return value is real number.
I believe that I need to use <math.h>
I have tried using :
if ( number == NAN)
Do this . .. .
However there is a compiler error NAN not declared.