After looking at another question on SO (Using NaN in C++) I became curious about std::numeric_limits
.
I could not get si
From TFM:
cout << "The signaling NaN for type float is: "
<< numeric_limits::signaling_NaN( )
<< endl;
->
The signaling NaN for type float is: 1.#QNAN
where the 'Q' stands for 'Quiet'. Dunno why it would return that, but that's why it doesn't throw an exception for you.
Out of curiosity, does this work better?
const double &real_snan( void )
{
static const long long snan = 0x7ff0000080000001LL;
return *(double*)&snan;
}