Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

numeric_limits::has_signaling_NaN

Tests whether a type has a representation for signaling not a number (NAN).

static const bool has_signaling_NaN = false;

true if the type has a representation for a signaling NAN; false if not.

A signaling NAN is an encoding for not a number, which signals its presence in an expression. The return value is true is_iec559 is true.

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

using namespace std;

int main( )
{
   cout << "Whether float objects have a signaling_NaN: "
        << numeric_limits<float>::has_signaling_NaN 
        << endl;
   cout << "Whether double objects have a signaling_NaN: "
        << numeric_limits<double>::has_signaling_NaN 
        << endl;
   cout << "Whether long int objects have a signaling_NaN: " 
        << numeric_limits<long int>::has_signaling_NaN 
        << endl;
}
Whether float objects have a signaling_NaN: 1
Whether double objects have a signaling_NaN: 1
Whether long int objects have a signaling_NaN: 0

Header: <limits>

Namespace: std

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.