Re: Internal NAN representation for double
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 0x7FF8. 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 0x7FC0. You can use something like this (under CodeWarrior, at least): long long lNaN = 0x7FF8; double dNan = *(double*)&lNaN; long iNan = 0x7FC0; float fNan = *(float*)&iNaN; -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Internal NAN representation for double
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 0x7FF8. 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? -- Luc Le Blanc -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Re: Internal NAN representation for double
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 0x7FF8. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/