다음을 통해 공유


numeric_limits::quiet_NaN

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

static Type quiet_NaN( ) throw( );

Return Value

The representation of a quiet NAN for the type.

Remarks

The return value is meaningful only if has_quiet_NaN is true.

Example

// 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

Requirements

Header: <limits>

Namespace: std

See Also

Concepts

strstreambuf Class

numeric_limits Members