At 08:57 AM 9/8/2003, Luc Le Blanc wrote:
Greg Lutz a �crit :

> At 06:50 AM 9/8/2003, you wrote:
> >I want to set a double to an "undefined" value for later detection.
> >Mathlib comes with a isnan API, but how do I set a double as a NAN? All
> >1's? This does not seem to work.
>
> The Java value Double.NaN displays as 0x7FF8000000000000.

Can you tell me Float.NaN as well, I realize I have floats too. Is there a
neat way to set a float or double as NAN?

Float.Nan is 0x7FC00000.


You can use something like this (under CodeWarrior, at least):

long long lNaN = 0x7FF8000000000000;
double dNan = *(double*)&lNaN;

long iNan = 0x7FC00000;
float fNan = *(float*)&iNaN;





-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to