Export (0) Print
Expand All

numeric_limits::is_iec559

Tests if a type conforms to IEC 559 standards.

static const bool is_iec559 = false;

true if the type conforms to the IEC 559 standards; false if not.

The IEC 559 is an international standard for representing floating-point values and is also known as IEEE 754 in the USA.

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

using namespace std;

int main( )
{
   cout << "Whether float objects conform to iec559 standards: "
        << numeric_limits<float>::is_iec559
        << endl;
   cout << "Whether double objects conform to iec559 standards: "
        << numeric_limits<double>::is_iec559
        << endl;
   cout << "Whether int objects conform to iec559 standards: "
        << numeric_limits<int>::is_iec559
        << endl;
   cout << "Whether unsigned char objects conform to iec559 standards: "
        << numeric_limits<unsigned char>::is_iec559
        << endl;
}
Whether float objects conform to iec559 standards: 1
Whether double objects conform to iec559 standards: 1
Whether int objects conform to iec559 standards: 0
Whether unsigned char objects conform to iec559 standards: 0

Header: <limits>

Namespace: std

Community Additions

ADD
Show:
© 2014 Microsoft