
26 Feb
2008
26 Feb
'08
9:31 a.m.
Johan RĂ¥de wrote:
If I enable SSE2 on VC71 and optimize the code for speed (/O2), then
-std::numeric_limits<double>::quiet_nan()
returns a positive NaN (binary expansion 7ff8000000000000), while
boost::math::changesign(std::numeric_limits<double>::quiet_nan())
returns a negative NaN (binary expansion fff8000000000000).
If I turn off the compiler optimization, then both return a negative NaN.
Conclusion: boost::math::changesign is useful.
Well, if that's the only use, then personally I won't be using it, what use is a negative NaN over a positive one? This feels like a very borderline use case to me, but maybe I'm missing something? John.