Partager via


numeric_limits::has_infinity

Tests whether a type has a representation for positive infinity.

static const bool has_infinity = false;

Return Value

true if the type has a representation for positive infinity; false if not.

Remarks

The member returns true if is_iec559 is true.

Example

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

using namespace std;

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

Requirements

Header: <limits>

Namespace: std

See Also

Reference

strstreambuf Class