|
Boost Users : |
From: Malte Clasen (news_at_[hidden])
Date: 2007-09-25 16:30:05
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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net