Export (0) Print
Expand All

numeric_limits::quiet_NaN

Returns the representation of a quiet not a number (NAN) for the type.

static Type quiet_NaN( ) throw( );

The representation of a quiet NAN for the type.

The return value is meaningful only if has_quiet_NaN is true.

// numeric_limits_quiet_nan.cpp
// compile with: /EHsc
#include <iostream>
#include <limits>

using namespace std;

int main( )
{
   cout << "The quiet NaN for type float is:  "
        << numeric_limits<float>::quiet_NaN( )
        << endl;
   cout << "The quiet NaN for type int is:  "
        << numeric_limits<int>::quiet_NaN( )
        << endl;
   cout << "The quiet NaN for type long double is:  "
        << numeric_limits<long double>::quiet_NaN( )
        << endl;
}
The quiet NaN for type float is:  1.#QNAN
The quiet NaN for type int is:  0
The quiet NaN for type long double is:  1.#QNAN

Header: <limits>

Namespace: std

Show:
© 2014 Microsoft