<p>After looking at another question on SO (<a href="https://stackoverflow.com/questions/235386/using-nan-in-c">Using NaN in C++</a>) I became curious about <code>std::numeric_limits&lt;double&gt;::signaling_NaN()</code>.</p>

<p>I could not get signaling_NaN to throw an exception. I thought perhaps by signaling it really meant a signal so I tried catching SIGFPE but nope...</p>

<p>Here is my code:</p>

<pre><code>double my_nan = numeric_limits&lt;double&gt;::signaling_NaN();
my_nan++;
my_nan += 5;
my_nan = my_nan / 10;
my_nan = 15 / my_nan;
cout &lt;&lt; my_nan &lt;&lt; endl;
</code></pre>

<p><code>numeric_limits&lt;double&gt;::has_signaling_NaN</code> evaluates to true, so it is implemented on my system.</p>

<p>Any ideas?</p>

<p>I am using ms visual studio .net 2003's C++ compiler. I want to test it on another when I get home.</p>

<p>Thanks!</p>

From
TFM
:
```
```
cout << "The signaling NaN for type float is:  "
    << numeric_limits<float>::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;
}
```
```