numeric_limits Class
The template class describes arithmetic properties of built-in numerical types.
template<classType> class numeric_limits
Parameters
- Type
The fundamental element data type whose properties are being tested or queried or set.
Remarks
The header defines explicit specializations for the types wchar_t, bool, char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, float, double, long double**,** long long, unsigned long long, char16_t, and char32_t. For these explicit specializations, the member numeric_limits::is_specialized is true, and all relevant members have meaningful values. The program can supply additional explicit specializations. Most member functions of the class describe or test possible implementations of float.
For an arbitrary specialization, no members have meaningful values. A member object that does not have a meaningful value stores zero (or false) and a member function that does not return a meaningful value returns Type(0).
Static Functions and Constants
Returns the smallest nonzero denormalized value. |
|
Returns the number of radix digits that the type can represent without loss of precision. |
|
Returns the number of decimal digits that the type can represent without loss of precision. |
|
Returns the difference between 1 and the smallest value greater than 1 that the data type can represent. |
|
Tests whether a type allows denormalized values. |
|
Tests whether loss of accuracy is detected as a denormalization loss rather than as an inexact result. |
|
Tests whether a type has a representation for positive infinity. |
|
Tests whether a type has a representation for a quiet not a number (NAN), which is nonsignaling. |
|
Tests whether a type has a representation for signaling not a number (NAN). |
|
The representation for positive infinity for a type, if available. |
|
Tests if the set of values that a type may represent is finite. |
|
Tests if the calculations done on a type are free of rounding errors. |
|
Tests if a type conforms to IEC 559 standards. |
|
Tests if a type has an integer representation. |
|
Tests if a type has a modulo representation. |
|
Tests if a type has a signed representation. |
|
Tests if a type has an explicit specialization defined in the template class numeric_limits. |
|
Returns the most negative finite value. |
|
Returns the maximum finite value for a type. |
|
Returns the number of decimal digits required to ensure that two distinct values of the type have distinct decimal representations. |
|
Returns the maximum positive integral exponent that the floating-point type can represent as a finite value when a base of radix is raised to that power. |
|
Returns the maximum positive integral exponent that the floating-point type can represent as a finite value when a base of ten is raised to that power. |
|
Returns the minimum normalized value for a type. |
|
Returns the maximum negative integral exponent that the floating-point type can represent as a finite value when a base of radix is raised to that power. |
|
Returns the maximum negative integral exponent that the floating-point type can represent as a finite value when a base of ten is raised to that power. |
|
Returns the representation of a quiet not a number (NAN) for the type. |
|
Returns the integral base, referred to as radix, used for the representation of a type. |
|
Returns the maximum rounding error for the type. |
|
Returns a value that describes the various methods that an implementation can choose for rounding a floating-point value to an integer value. |
|
Returns the representation of a signaling not a number (NAN) for the type. |
|
Tests whether a type can determine that a value is too small to represent as a normalized value before rounding it. |
|
Tests whether trapping that reports on arithmetic exceptions is implemented for a type. |
Requirements
Header: <limits>
Namespace: std