Re: numeric_limits question
Try to add the include <math.h>
From MSDN:
Code:
DBL_MAX 1.7976931348623158e+308 Maximum value
Re: numeric_limits question
But this could vary from compiler to compiler. I need a function or macro. Also what about Nan?
Re: numeric_limits question
Just to answer my own question just incase anyone else faces this problem:
In gcc there are INFINITY and NAN defines in math.h. However you need to compile the source with gcc -std::c99. Windows has there own macros. You can find them in float.h
Re: numeric_limits question
The double type follows the IEEE 754 standard, please look it up at wikipedia. Certain bit combinations don´t represent a valid double, instead they´re used to code special cases like NaN, positive infinity and the like. When your compiler does not support these cases you can define them by your own by providing the according bit combinations.