
25 Sep
2007
25 Sep
'07
8:30 p.m.
Thomas Thorp wrote:
3 - Is there a way to test for 1.#QNAN in a floating point value? This is part of my initialization sequence. "BOOST_CHECK_EQUAL" results a failure.
Although I don't know BOOST_CHECK_EQUAL, I suspect that i uses the == operator for floats and doubles. Since every comparison with NaN results in false, this won't work. However, TR1 incorporates the C99 isnan() function, according to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf , page 163/164. If your compiler vendor doesn't support it, yet, you might want to search the boost libraries for is_nan. Malte