5#ifndef INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_NUMERIC_LIMITS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_NUMERIC_LIMITS_HPP_
35#if defined(__FAST_MATH__)
36#error "Fast math not supported as does not conform to IEC559"
40#if defined(__FINITE_MATH_ONLY__) && (__FINITE_MATH_ONLY__ == 1)
41#error "Finite math only not supported does not conform to IEC559"
46#if defined(__NO_TRAPPING_MATH__) && (__NO_TRAPPING_MATH__ == 1)
47#error "Disabling trapping math not supported as it does not conform to IEC559"
52#if defined(__GCC_IEC_559) && (__GCC_IEC_559 == 0)
53#error "Unsupported floating point mode that does not conform to IEC559 enabled"
63static_assert(CHAR_BIT == 8,
"Values only correct for platforms with 8-bit bytes");
166template <
typename T,
typename = arene::base::constra
ints<>>
230 static constexpr auto max() noexcept -> T {
return T(); }
235 static constexpr auto min() noexcept -> T {
return T(); }
238 static constexpr auto lowest() noexcept -> T {
return T(); }
243 static constexpr auto epsilon() noexcept -> T {
return T(); }
249 static constexpr auto infinity() noexcept -> T {
return T(); }
253 static constexpr auto quiet_NaN() noexcept -> T {
return T(); }
261 static constexpr auto denorm_min() noexcept -> T {
return T(); }
285 static constexpr int digits{
static_cast<int>(
286 is_signed ? (
sizeof(T) *
static_cast<unsigned>(CHAR_BIT) - 1U) : (
sizeof(T) *
static_cast<unsigned>(CHAR_BIT))
339 static constexpr auto max() noexcept -> T {
341 :
static_cast<T
>(
int_info<
sizeof(T)>::unsigned_max);
345 static constexpr auto min() noexcept -> T {
346 return is_signed ?
static_cast<T
>(
int_info<
sizeof(T)>::signed_min) :
static_cast<T
>(0);
350 static constexpr auto lowest() noexcept -> T {
return min(); }
355 static constexpr auto epsilon() noexcept -> T {
return T{}; }
361 static constexpr auto infinity() noexcept -> T {
return T{}; }
365 static constexpr auto quiet_NaN() noexcept -> T {
return T{}; }
373 static constexpr auto denorm_min() noexcept -> T {
return T{}; }
440 static constexpr auto max() noexcept ->
bool {
return true; }
443 static constexpr auto min() noexcept ->
bool {
return false; }
446 static constexpr auto lowest() noexcept ->
bool {
return min(); }
451 static constexpr auto epsilon() noexcept ->
bool {
return false; }
454 static constexpr auto round_error() noexcept ->
bool {
return false; }
457 static constexpr auto infinity() noexcept ->
bool {
return false; }
461 static constexpr auto quiet_NaN() noexcept ->
bool {
return false; }
469 static constexpr auto denorm_min() noexcept ->
bool {
return false; }
493 static constexpr int radix{FLT_RADIX};
495 static constexpr int digits{FLT_MANT_DIG};
544 static constexpr auto max() noexcept ->
float {
return FLT_MAX; }
547 static constexpr auto min() noexcept ->
float {
return FLT_MIN; }
550 static constexpr auto lowest() noexcept ->
float {
return -FLT_MAX; }
555 static constexpr auto epsilon() noexcept ->
float {
return FLT_EPSILON; }
560 constexpr float rounding_error_value{0.5F};
561 return rounding_error_value;
565 static constexpr auto infinity() noexcept ->
float {
return __builtin_inff(); }
571 return __builtin_nanf(
"0");
579 return __builtin_nansf(
"0");
587 static_assert(FLT_MANT_DIG < (
sizeof(
unsigned long long) * CHAR_BIT),
"Ensure shift doesn't overflow");
594 constexpr float min_value{FLT_MIN /
static_cast<float>(1ULL <<
static_cast<unsigned>(FLT_MANT_DIG - 1))};
614 static constexpr int radix{FLT_RADIX};
616 static constexpr int digits{DBL_MANT_DIG};
668 static constexpr auto max() noexcept ->
double {
return DBL_MAX; }
674 static constexpr auto min() noexcept ->
double {
return DBL_MIN; }
680 static constexpr auto lowest() noexcept ->
double {
return -DBL_MAX; }
687 static constexpr auto epsilon() noexcept ->
double {
return DBL_EPSILON; }
694 constexpr double rounding_error_value{0.5};
695 return rounding_error_value;
699 static constexpr auto infinity() noexcept ->
double {
return __builtin_inf(); }
705 return __builtin_nan(
"0");
713 return __builtin_nans(
"0");
721 static_assert(DBL_MANT_DIG < (
sizeof(
unsigned long long) * CHAR_BIT),
"Ensure shift doesn't overflow");
728 constexpr double min_value{DBL_MIN /
static_cast<double>(1ULL <<
static_cast<unsigned>(DBL_MANT_DIG - 1))};
static constexpr bool has_quiet_NaN
For floating point types, true if the type has a representation of a quiet (non-signaling) "Not-a-Num...
Definition numeric_limits.hpp:320
static constexpr auto epsilon() noexcept -> T
For floating point types, the epsilon value: the difference between 1 and the least representable val...
Definition numeric_limits.hpp:355
static constexpr bool has_signaling_NaN
For floating point types, true if the type has a representation of a signaling "Not-a-Number",...
Definition numeric_limits.hpp:324
static constexpr bool is_specialized
Is this a specialization for which the other values are meaningful? true if so, false otherwise.
Definition numeric_limits.hpp:270
static constexpr bool tinyness_before
For floating point types, true if tinyness is detected before rounding, otherwise false.
Definition numeric_limits.hpp:333
static constexpr int max_exponent10
For floating point types, the maximum positive integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:314
static constexpr auto signaling_NaN() noexcept -> T
For floating point types where has_signaling_NaN is true, a representation of a signaling NaN.
Definition numeric_limits.hpp:369
static constexpr auto lowest() noexcept -> T
The minimum finite value such that there is no finite value y such that y<lowest()
Definition numeric_limits.hpp:350
static constexpr int digits10
The maximum number of base-10 digits that can be completely represented in values of the type.
Definition numeric_limits.hpp:291
static constexpr auto max() noexcept -> T
The maximum finite value.
Definition numeric_limits.hpp:339
static constexpr bool is_signed
Is the type a signed type? true if so, false otherwise.
Definition numeric_limits.hpp:278
static constexpr int min_exponent
For floating point types, the minimum negative integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:305
static constexpr auto infinity() noexcept -> T
For floating point types where has_infinity is true, a representation of positive infinity.
Definition numeric_limits.hpp:361
static constexpr bool is_integer
Is the type an integral type? true if so, false otherwise.
Definition numeric_limits.hpp:272
static constexpr auto round_error() noexcept -> T
For floating point types, the maximum rounding error.
Definition numeric_limits.hpp:358
static constexpr float_round_style round_style
For floating point types, an indicator of the default rounding style.
Definition numeric_limits.hpp:335
static constexpr bool is_exact
Is the type an exact type? true if so, false otherwise.
Definition numeric_limits.hpp:274
static constexpr int max_digits10
For floating point types, the number of base-10 digits required to ensure that values which differ ca...
Definition numeric_limits.hpp:302
static constexpr auto denorm_min() noexcept -> T
For floating point types, the minimum positive denormalized value. If the representation has no denor...
Definition numeric_limits.hpp:373
static constexpr float_denorm_style has_denorm
For floating point types, an indicator of whether the type has a representation of denormalized value...
Definition numeric_limits.hpp:326
static constexpr int min_exponent10
For floating point types, the minimum negative integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:308
static constexpr bool is_bounded
true if the set of values representable by the type is bounded, otherwise false
Definition numeric_limits.hpp:294
static constexpr bool has_infinity
For floating point types, true if the type has a representation of positive infinity,...
Definition numeric_limits.hpp:316
static constexpr int digits
The number of radix digits in the representation, ignoring any sign bit.
Definition numeric_limits.hpp:285
static constexpr bool traps
true if there are trap representations of this type, otherwise false
Definition numeric_limits.hpp:298
static constexpr int max_exponent
For floating point types, the maximum positive integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:311
static constexpr auto min() noexcept -> T
The minimum finite value; the minimum positive normalized value for floating point types.
Definition numeric_limits.hpp:345
static constexpr bool is_iec559
For floating point types, true if the type adheres to the IEC559 standard, otherwise false.
Definition numeric_limits.hpp:331
static constexpr int radix
The base used for the representation.
Definition numeric_limits.hpp:282
static constexpr auto quiet_NaN() noexcept -> T
For floating point types where has_quiet_NaN is true, a representation of a quiet NaN.
Definition numeric_limits.hpp:365
static constexpr bool is_modulo
true if the set of values representable by the type is modulo, otherwise false
Definition numeric_limits.hpp:296
static constexpr bool has_denorm_loss
For floating point types, true if loss of accuracy is detected as a denormalization loss rather than ...
Definition numeric_limits.hpp:329
static constexpr int max_exponent10
For floating point types, the maximum positive integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:415
static constexpr int digits10
The maximum number of base-10 digits that can be completely represented in values of the type.
Definition numeric_limits.hpp:393
static constexpr auto quiet_NaN() noexcept -> bool
For floating point types where has_quiet_NaN is true, a representation of a quiet NaN.
Definition numeric_limits.hpp:461
static constexpr bool has_denorm_loss
For floating point types, true if loss of accuracy is detected as a denormalization loss rather than ...
Definition numeric_limits.hpp:430
static constexpr bool is_bounded
true if the set of values representable by the type is bounded, otherwise false
Definition numeric_limits.hpp:395
static constexpr int radix
The base used for the representation.
Definition numeric_limits.hpp:389
static constexpr auto max() noexcept -> bool
The maximum finite value.
Definition numeric_limits.hpp:440
static constexpr auto lowest() noexcept -> bool
The minimum finite value such that there is no finite value y such that y<lowest()
Definition numeric_limits.hpp:446
static constexpr auto min() noexcept -> bool
The minimum finite value; the minimum positive normalized value for floating point types.
Definition numeric_limits.hpp:443
static constexpr bool is_exact
Is the type an exact type? true if so, false otherwise.
Definition numeric_limits.hpp:385
static constexpr bool traps
true if there are trap representations of this type, otherwise false
Definition numeric_limits.hpp:399
static constexpr bool has_signaling_NaN
For floating point types, true if the type has a representation of a signaling "Not-a-Number",...
Definition numeric_limits.hpp:425
static constexpr auto infinity() noexcept -> bool
For floating point types where has_infinity is true, a representation of positive infinity.
Definition numeric_limits.hpp:457
static constexpr auto round_error() noexcept -> bool
For floating point types, the maximum rounding error.
Definition numeric_limits.hpp:454
static constexpr bool is_iec559
For floating point types, true if the type adheres to the IEC559 standard, otherwise false.
Definition numeric_limits.hpp:432
static constexpr float_round_style round_style
For floating point types, an indicator of the default rounding style.
Definition numeric_limits.hpp:436
static constexpr bool has_quiet_NaN
For floating point types, true if the type has a representation of a quiet (non-signaling) "Not-a-Num...
Definition numeric_limits.hpp:421
static constexpr bool is_integer
Is the type an integral type? true if so, false otherwise.
Definition numeric_limits.hpp:383
static constexpr bool tinyness_before
For floating point types, true if tinyness is detected before rounding, otherwise false.
Definition numeric_limits.hpp:434
static constexpr int min_exponent10
For floating point types, the minimum negative integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:409
static constexpr int max_digits10
For floating point types, the number of base-10 digits required to ensure that values which differ ca...
Definition numeric_limits.hpp:403
static constexpr bool has_infinity
For floating point types, true if the type has a representation of positive infinity,...
Definition numeric_limits.hpp:417
static constexpr int digits
The number of radix digits in the representation, ignoring any sign bit.
Definition numeric_limits.hpp:391
static constexpr int min_exponent
For floating point types, the minimum negative integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:406
static constexpr bool is_modulo
true if the set of values representable by the type is modulo, otherwise false
Definition numeric_limits.hpp:397
static constexpr float_denorm_style has_denorm
For floating point types, an indicator of whether the type has a representation of denormalized value...
Definition numeric_limits.hpp:427
static constexpr int max_exponent
For floating point types, the maximum positive integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:412
static constexpr auto denorm_min() noexcept -> bool
For floating point types, the minimum positive denormalized value. If the representation has no denor...
Definition numeric_limits.hpp:469
static constexpr auto epsilon() noexcept -> bool
For floating point types, the epsilon value: the difference between 1 and the least representable val...
Definition numeric_limits.hpp:451
static constexpr bool is_specialized
Is this a specialization for which the other values are meaningful? true if so, false otherwise.
Definition numeric_limits.hpp:381
static constexpr auto signaling_NaN() noexcept -> bool
For floating point types where has_signaling_NaN is true, a representation of a signaling NaN.
Definition numeric_limits.hpp:465
static constexpr bool is_signed
Is the type a signed type? true if so, false otherwise.
Definition numeric_limits.hpp:387
static constexpr bool traps
true if there are trap representations of this type, otherwise false
Definition numeric_limits.hpp:624
static constexpr bool is_iec559
For floating point types, true if the type adheres to the IEC559 standard, otherwise false.
Definition numeric_limits.hpp:659
static constexpr float_round_style round_style
For floating point types, an indicator of the default rounding style.
Definition numeric_limits.hpp:663
static constexpr int max_exponent10
For floating point types, the maximum positive integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:640
static constexpr bool is_signed
Is the type a signed type? true if so, false otherwise.
Definition numeric_limits.hpp:612
static constexpr int radix
The base used for the representation.
Definition numeric_limits.hpp:614
static constexpr bool is_specialized
Is this a specialization for which the other values are meaningful? true if so, false otherwise.
Definition numeric_limits.hpp:606
static constexpr auto lowest() noexcept -> double
The minimum finite value such that there is no finite value y such that y<lowest()
Definition numeric_limits.hpp:680
static constexpr bool tinyness_before
For floating point types, true if tinyness is detected before rounding, otherwise false.
Definition numeric_limits.hpp:661
static constexpr int digits
The number of radix digits in the representation, ignoring any sign bit.
Definition numeric_limits.hpp:616
static constexpr int max_digits10
For floating point types, the number of base-10 digits required to ensure that values which differ ca...
Definition numeric_limits.hpp:628
static constexpr bool has_denorm_loss
For floating point types, true if loss of accuracy is detected as a denormalization loss rather than ...
Definition numeric_limits.hpp:657
static constexpr int min_exponent
For floating point types, the minimum negative integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:631
static constexpr bool is_bounded
true if the set of values representable by the type is bounded, otherwise false
Definition numeric_limits.hpp:620
static constexpr bool is_integer
Is the type an integral type? true if so, false otherwise.
Definition numeric_limits.hpp:608
static constexpr auto max() noexcept -> double
The maximum finite value.
Definition numeric_limits.hpp:668
static constexpr bool is_modulo
true if the set of values representable by the type is modulo, otherwise false
Definition numeric_limits.hpp:622
static constexpr auto epsilon() noexcept -> double
For floating point types, the epsilon value: the difference between 1 and the least representable val...
Definition numeric_limits.hpp:687
static constexpr float_denorm_style has_denorm
For floating point types, an indicator of whether the type has a representation of denormalized value...
Definition numeric_limits.hpp:654
static constexpr int min_exponent10
For floating point types, the minimum negative integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:634
static constexpr bool is_exact
Is the type an exact type? true if so, false otherwise.
Definition numeric_limits.hpp:610
static constexpr auto signaling_NaN() noexcept -> double
For floating point types where has_signaling_NaN is true, a representation of a signaling NaN.
Definition numeric_limits.hpp:711
static constexpr int digits10
The maximum number of base-10 digits that can be completely represented in values of the type.
Definition numeric_limits.hpp:618
static constexpr auto denorm_min() noexcept -> double
For floating point types, the minimum positive denormalized value. If the representation has no denor...
Definition numeric_limits.hpp:719
static constexpr bool has_quiet_NaN
For floating point types, true if the type has a representation of a quiet (non-signaling) "Not-a-Num...
Definition numeric_limits.hpp:647
static constexpr auto round_error() noexcept -> double
For floating point types, the maximum rounding error.
Definition numeric_limits.hpp:693
static constexpr auto min() noexcept -> double
The minimum finite value; the minimum positive normalized value for floating point types.
Definition numeric_limits.hpp:674
static constexpr bool has_signaling_NaN
For floating point types, true if the type has a representation of a signaling "Not-a-Number",...
Definition numeric_limits.hpp:652
static constexpr auto infinity() noexcept -> double
For floating point types where has_infinity is true, a representation of positive infinity.
Definition numeric_limits.hpp:699
static constexpr bool has_infinity
For floating point types, true if the type has a representation of positive infinity,...
Definition numeric_limits.hpp:643
static constexpr auto quiet_NaN() noexcept -> double
For floating point types where has_quiet_NaN is true, a representation of a quiet NaN.
Definition numeric_limits.hpp:703
static constexpr int max_exponent
For floating point types, the maximum positive integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:637
static constexpr bool is_specialized
Is this a specialization for which the other values are meaningful? true if so, false otherwise.
Definition numeric_limits.hpp:485
static constexpr int min_exponent
For floating point types, the minimum negative integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:510
static constexpr auto denorm_min() noexcept -> float
For floating point types, the minimum positive denormalized value. If the representation has no denor...
Definition numeric_limits.hpp:585
static constexpr auto signaling_NaN() noexcept -> float
For floating point types where has_signaling_NaN is true, a representation of a signaling NaN.
Definition numeric_limits.hpp:577
static constexpr bool has_quiet_NaN
For floating point types, true if the type has a representation of a quiet (non-signaling) "Not-a-Num...
Definition numeric_limits.hpp:525
static constexpr bool has_infinity
For floating point types, true if the type has a representation of positive infinity,...
Definition numeric_limits.hpp:521
static constexpr bool has_signaling_NaN
For floating point types, true if the type has a representation of a signaling "Not-a-Number",...
Definition numeric_limits.hpp:529
static constexpr int max_digits10
For floating point types, the number of base-10 digits required to ensure that values which differ ca...
Definition numeric_limits.hpp:507
static constexpr int min_exponent10
For floating point types, the minimum negative integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:513
static constexpr int digits10
The maximum number of base-10 digits that can be completely represented in values of the type.
Definition numeric_limits.hpp:497
static constexpr auto max() noexcept -> float
The maximum finite value.
Definition numeric_limits.hpp:544
static constexpr auto round_error() noexcept -> float
For floating point types, the maximum rounding error.
Definition numeric_limits.hpp:559
static constexpr bool has_denorm_loss
For floating point types, true if loss of accuracy is detected as a denormalization loss rather than ...
Definition numeric_limits.hpp:534
static constexpr int radix
The base used for the representation.
Definition numeric_limits.hpp:493
static constexpr bool traps
true if there are trap representations of this type, otherwise false
Definition numeric_limits.hpp:503
static constexpr auto lowest() noexcept -> float
The minimum finite value such that there is no finite value y such that y<lowest()
Definition numeric_limits.hpp:550
static constexpr float_denorm_style has_denorm
For floating point types, an indicator of whether the type has a representation of denormalized value...
Definition numeric_limits.hpp:531
static constexpr bool is_signed
Is the type a signed type? true if so, false otherwise.
Definition numeric_limits.hpp:491
static constexpr bool is_iec559
For floating point types, true if the type adheres to the IEC559 standard, otherwise false.
Definition numeric_limits.hpp:536
static constexpr bool is_integer
Is the type an integral type? true if so, false otherwise.
Definition numeric_limits.hpp:487
static constexpr auto infinity() noexcept -> float
For floating point types where has_infinity is true, a representation of positive infinity.
Definition numeric_limits.hpp:565
static constexpr bool is_bounded
true if the set of values representable by the type is bounded, otherwise false
Definition numeric_limits.hpp:499
static constexpr bool is_modulo
true if the set of values representable by the type is modulo, otherwise false
Definition numeric_limits.hpp:501
static constexpr int max_exponent10
For floating point types, the maximum positive integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:519
static constexpr int max_exponent
For floating point types, the maximum positive integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:516
static constexpr bool tinyness_before
For floating point types, true if tinyness is detected before rounding, otherwise false.
Definition numeric_limits.hpp:538
static constexpr auto min() noexcept -> float
The minimum finite value; the minimum positive normalized value for floating point types.
Definition numeric_limits.hpp:547
static constexpr auto epsilon() noexcept -> float
For floating point types, the epsilon value: the difference between 1 and the least representable val...
Definition numeric_limits.hpp:555
static constexpr auto quiet_NaN() noexcept -> float
For floating point types where has_quiet_NaN is true, a representation of a quiet NaN.
Definition numeric_limits.hpp:569
static constexpr int digits
The number of radix digits in the representation, ignoring any sign bit.
Definition numeric_limits.hpp:495
static constexpr float_round_style round_style
For floating point types, an indicator of the default rounding style.
Definition numeric_limits.hpp:540
static constexpr bool is_exact
Is the type an exact type? true if so, false otherwise.
Definition numeric_limits.hpp:489
Implementation template for numeric_limits.
Definition numeric_limits.hpp:167
static constexpr bool has_signaling_NaN
For floating point types, true if the type has a representation of a signaling "Not-a-Number",...
Definition numeric_limits.hpp:214
static constexpr int digits10
The maximum number of base-10 digits that can be completely represented in values of the type.
Definition numeric_limits.hpp:182
static constexpr auto denorm_min() noexcept -> T
For floating point types, the minimum positive denormalized value. If the representation has no denor...
Definition numeric_limits.hpp:261
static constexpr bool has_quiet_NaN
For floating point types, true if the type has a representation of a quiet (non-signaling) "Not-a-Num...
Definition numeric_limits.hpp:210
static constexpr auto min() noexcept -> T
The minimum finite value; the minimum positive normalized value for floating point types.
Definition numeric_limits.hpp:235
static constexpr float_denorm_style has_denorm
For floating point types, an indicator of whether the type has a representation of denormalized value...
Definition numeric_limits.hpp:216
static constexpr auto lowest() noexcept -> T
The minimum finite value such that there is no finite value y such that y<lowest()
Definition numeric_limits.hpp:238
static constexpr bool is_iec559
For floating point types, true if the type adheres to the IEC559 standard, otherwise false.
Definition numeric_limits.hpp:221
static constexpr auto infinity() noexcept -> T
For floating point types where has_infinity is true, a representation of positive infinity.
Definition numeric_limits.hpp:249
static constexpr auto signaling_NaN() noexcept -> T
For floating point types where has_signaling_NaN is true, a representation of a signaling NaN.
Definition numeric_limits.hpp:257
static constexpr int max_exponent10
For floating point types, the maximum positive integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:204
static constexpr bool has_denorm_loss
For floating point types, true if loss of accuracy is detected as a denormalization loss rather than ...
Definition numeric_limits.hpp:219
static constexpr bool traps
true if there are trap representations of this type, otherwise false
Definition numeric_limits.hpp:188
static constexpr auto quiet_NaN() noexcept -> T
For floating point types where has_quiet_NaN is true, a representation of a quiet NaN.
Definition numeric_limits.hpp:253
static constexpr int digits
The number of radix digits in the representation, ignoring any sign bit.
Definition numeric_limits.hpp:180
static constexpr auto round_error() noexcept -> T
For floating point types, the maximum rounding error.
Definition numeric_limits.hpp:246
static constexpr int min_exponent
For floating point types, the minimum negative integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:195
static constexpr int min_exponent10
For floating point types, the minimum negative integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:198
static constexpr bool is_bounded
true if the set of values representable by the type is bounded, otherwise false
Definition numeric_limits.hpp:184
static constexpr auto epsilon() noexcept -> T
For floating point types, the epsilon value: the difference between 1 and the least representable val...
Definition numeric_limits.hpp:243
static constexpr bool is_modulo
true if the set of values representable by the type is modulo, otherwise false
Definition numeric_limits.hpp:186
static constexpr bool is_specialized
Is this a specialization for which the other values are meaningful? true if so, false otherwise.
Definition numeric_limits.hpp:170
static constexpr bool is_integer
Is the type an integral type? true if so, false otherwise.
Definition numeric_limits.hpp:172
static constexpr bool has_infinity
For floating point types, true if the type has a representation of positive infinity,...
Definition numeric_limits.hpp:206
static constexpr float_round_style round_style
For floating point types, an indicator of the default rounding style.
Definition numeric_limits.hpp:225
static constexpr bool is_exact
Is the type an exact type? true if so, false otherwise.
Definition numeric_limits.hpp:174
static constexpr bool is_signed
Is the type a signed type? true if so, false otherwise.
Definition numeric_limits.hpp:176
static constexpr int max_digits10
For floating point types, the number of base-10 digits required to ensure that values which differ ca...
Definition numeric_limits.hpp:192
static constexpr int radix
The base used for the representation.
Definition numeric_limits.hpp:178
static constexpr bool tinyness_before
For floating point types, true if tinyness is detected before rounding, otherwise false.
Definition numeric_limits.hpp:223
static constexpr auto max() noexcept -> T
The maximum finite value.
Definition numeric_limits.hpp:230
static constexpr int max_exponent
For floating point types, the maximum positive integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:201
Traits class to provide information about the representation of arithmetic types.
Definition numeric_limits.hpp:745
Public export header for the constraints subpackage.
Definition accumulate.hpp:36
Definition numeric_limits.hpp:93
constexpr int log10_2_den
Denominator for log10(2) as a fraction.
Definition numeric_limits.hpp:478
constexpr int log10_2_num
Numerator for log10(2) as a fraction.
Definition numeric_limits.hpp:476
::int32_t int32_t
A 32-bit signed integer type.
Definition cstdint.hpp:66
float_round_style
Enumeration describing possible rounding styles.
Definition numeric_limits.hpp:67
@ round_toward_zero
Round towards zero.
Definition numeric_limits.hpp:71
@ round_toward_infinity
Round towards positive infinity.
Definition numeric_limits.hpp:75
@ round_to_nearest
Round towards nearest.
Definition numeric_limits.hpp:73
@ round_toward_neg_infinity
Round towards negative infinity.
Definition numeric_limits.hpp:77
@ round_indeterminate
Rounding is indeterminable.
Definition numeric_limits.hpp:69
::int16_t int16_t
A 16-bit signed integer type.
Definition cstdint.hpp:61
::uint8_t uint8_t
An 8-bit unsigned integer type.
Definition cstdint.hpp:30
::uint16_t uint16_t
A 16-bit unsigned integer type.
Definition cstdint.hpp:36
::uint32_t uint32_t
A 32-bit unsigned integer type.
Definition cstdint.hpp:41
::uint64_t uint64_t
A 64-bit unsigned integer type.
Definition cstdint.hpp:47
constexpr bool is_signed_v
A type trait to check if a type is signed. The value is true if Type is a signed type,...
::int8_t int8_t
An 8-bit signed integer type.
Definition cstdint.hpp:55
::int64_t int64_t
A 64-bit signed integer type.
Definition cstdint.hpp:71
float_denorm_style
Enumeration describing possible denormalized value representation properties.
Definition numeric_limits.hpp:83
@ denorm_present
This type has denormalized values.
Definition numeric_limits.hpp:89
@ denorm_indeterminate
It cannot be determined if this type has denormalized values.
Definition numeric_limits.hpp:85
@ denorm_absent
This type has no denormalized values.
Definition numeric_limits.hpp:87
static constexpr int digits10
The number of decimal digits.
Definition numeric_limits.hpp:103
static constexpr int8_t signed_max
The maximum value of a signed integer with this size.
Definition numeric_limits.hpp:109
static constexpr int unsigned_digits10
The number of decimal digits when unsigned.
Definition numeric_limits.hpp:105
static constexpr uint8_t unsigned_max
The maximum value of an unsigned integer with this size.
Definition numeric_limits.hpp:111
static constexpr int8_t signed_min
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:107
static constexpr int16_t signed_min
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:122
static constexpr int digits10
The number of decimal digits.
Definition numeric_limits.hpp:118
static constexpr int16_t signed_max
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:124
static constexpr uint16_t unsigned_max
The maximum value of an unsigned integer with this size.
Definition numeric_limits.hpp:126
static constexpr int unsigned_digits10
The number of decimal digits when unsigned.
Definition numeric_limits.hpp:120
static constexpr uint32_t unsigned_max
The maximum value of an unsigned integer with this size.
Definition numeric_limits.hpp:143
static constexpr int digits10
The number of decimal digits.
Definition numeric_limits.hpp:133
static constexpr int32_t signed_min
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:141
static constexpr int32_t signed_max
The maximum value of a signed integer with this size.
Definition numeric_limits.hpp:138
static constexpr int unsigned_digits10
The number of decimal digits when unsigned.
Definition numeric_limits.hpp:135
static constexpr int unsigned_digits10
The number of decimal digits when unsigned.
Definition numeric_limits.hpp:153
static constexpr int64_t signed_max
The maximum value of a signed integer with this size.
Definition numeric_limits.hpp:156
static constexpr uint64_t unsigned_max
The maximum value of an unsigned integer with this size.
Definition numeric_limits.hpp:161
static constexpr int64_t signed_min
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:159
static constexpr int digits10
The number of decimal digits.
Definition numeric_limits.hpp:151
Internal helper to define properties for integer types.
Definition numeric_limits.hpp:97