std::numeric_limits<T>::has_denorm_loss
|
|
Basic types | |||||||||||||||||||||
Fixed width integer types (C++11) | |||||||||||||||||||||
Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
Numeric limits | |||||||||||||||||||||
C numeric limits interface | |||||||||||||||||||||
Runtime type information | |||||||||||||||||||||
|
Static constants | ||||
numeric_limits::has_denorm_loss | ||||
(C++11)
|
||||
Static member functions | ||||
(C++11)
|
||||
Helper types | ||||
static const bool has_denorm_loss; |
(until C++11) | |
static constexpr bool has_denorm_loss; |
(since C++11) (deprecated in C++23) |
|
The value of
std::numeric_limits
<T>
::
has_denorm_loss
is true for all floating-point types T
Standard specializations
T
|
value of std::numeric_limits <T> :: has_denorm_loss |
/* non-specialized */ | false |
bool | false |
char | false |
signed char | false |
unsigned char | false |
wchar_t | false |
char8_t (since C++20) | false |
char16_t (since C++11) | false |
char32_t (since C++11) | false |
short | false |
unsigned short | false |
int | false |
unsigned int | false |
long | false |
unsigned long | false |
long long (since C++11) | false |
unsigned long long (since C++11) | false |
float | implementation-defined |
double | implementation-defined |
long double | implementation-defined |
Notes
Standard-compliant IEEE 754 floating-point implementations of subnormal numbers are required to detect the loss of accuracy associated with the creation of such number, if it occurs, and may do so in one of the two distinct ways:
- Denormalization loss: the delivered result differs from what would have been computed were exponent range unbounded.
- Inexact result: the delivered result differs from what would have been computed were both exponent range and precision unbounded.
No implementation of denormalization loss mechanism exists (accuracy loss is detected after rounding, as inexact result), and this option was removed in the 2008 revision of IEEE Std 754.
libstdc++, libc++, libCstd, and stlport4 define this constant as false for all floating-point types. Microsoft Visual Studio defines it as true
As with any floating-point computations, accuracy loss may raise FE_INEXACT.
Example
This section is incomplete Reason: no example |
See also
[static]
|
identifies floating-point types that detect tinyness before rounding (public static member constant) |
[static]
|
identifies the denormalization style used by the floating-point type (public static member constant) |