libfxd 0.2.dev
A fixed-point library for C++.
Loading...
Searching...
No Matches
numeric_limits< fxd::fixed< Int, Frac, Raw > > Struct Template Reference

Specialization: fxd::fixed is similar to floating-point. More...

#include <limits.hpp>

Public Types

using float_type = fxd::detail::select_float_t< digits >
 Extension: lossless conversion to a floating-point type.
 

Static Public Member Functions

static constexpr fxd::fixed< Int, Frac, Raw > min () noexcept
 Smallest positive value; same semantics as floating-point.
 
static constexpr fxd::fixed< Int, Frac, Raw > lowest () noexcept
 Closest value to -∞.
 
static constexpr fxd::fixed< Int, Frac, Raw > max () noexcept
 Maximum value.
 
static constexpr fxd::fixed< Int, Frac, Raw > epsilon () noexcept
 Smallest increment.
 
static constexpr fxd::fixed< Int, Frac, Raw > round_error () noexcept
 Maximum possible error.
 
static constexpr fxd::fixed< Int, Frac, Raw > infinity () noexcept
 Not meaningful, has_infinity is false.
 
static constexpr fxd::fixed< Int, Frac, Raw > quiet_NaN () noexcept
 Not meaningful, has_quiet_NaN is false.
 
static constexpr fxd::fixed< Int, Frac, Raw > signaling_NaN () noexcept
 Not meaningful, has_signaling_NaN is false.
 
static constexpr fxd::fixed< Int, Frac, Raw > denorm_min () noexcept
 Same as min() since there are no denormalized values.
 
static constexpr fxd::fixed< Int, Frac, Raw > max_pow2 () noexcept
 Extension: maximum power of two.
 

Static Public Attributes

static constexpr bool is_specialized = true
 This is a valid specialization.
 
static constexpr bool is_signed = numeric_limits<Raw>::is_signed
 Sign depends on the underlying integer type.
 
static constexpr bool is_integer = Frac <= 0
 If this represents integers only.
 
static constexpr bool is_exact = true
 All arithmetic is done with integers, so fxd::fixed is exact.
 
static constexpr bool has_infinity = false
 No representation for .
 
static constexpr bool has_quiet_NaN = false
 No NaN.
 
static constexpr bool has_signaling_NaN = false
 No NaN.
 
static constexpr float_denorm_style has_denorm = denorm_absent
 No denormals.
 
static constexpr bool has_denorm_loss = false
 No denormals.
 
static constexpr float_round_style round_style = round_toward_zero
 Default rounding is towards zero, just like with integers.
 
static constexpr bool is_iec559 = false
 Not a standard floating point type.
 
static constexpr bool is_bounded = numeric_limits<Raw>::is_bounded
 It's bounded by the underlying integer type.
 
static constexpr bool is_modulo = numeric_limits<Raw>::is_modulo
 It's modulo if the underlying integer is modulo.
 
static constexpr int radix = numeric_limits<Raw>::radix
 Same radix as the underlying integer.
 
static constexpr int digits
 fxd::fixed::bits - is_signed.
 
static constexpr int digits10
 Same estimation used for floating-point.
 
static constexpr int max_digits10
 Same estimation used for floating-point.
 
static constexpr int min_exponent = 1 - Frac
 Minimum power-of-two that can be stored.
 
static constexpr int min_exponent10
 Same estimation used for floating-point.
 
static constexpr int max_exponent = Int - is_signed
 Maximum power-of-two that can be stored.
 
static constexpr int max_exponent10
 Same estimation used for floating-point.
 
static constexpr bool traps = numeric_limits<Raw>::traps
 Depends on the underlying integer.
 
static constexpr bool tinyness_before = false
 Not meaningful.
 
static constexpr int max_bit = Int - is_signed
 Extension: maximum logical bit.
 
static constexpr int min_bit = - Frac
 Extension: minimum logical bit.
 

Detailed Description

template<int Int, int Frac, typename Raw>
requires (numeric_limits<Raw>::is_specialized)
struct std::numeric_limits< fxd::fixed< Int, Frac, Raw > >

Specialization: fxd::fixed is similar to floating-point.

Definition at line 30 of file limits.hpp.

Member Typedef Documentation

◆ float_type

using float_type = fxd::detail::select_float_t<digits>

Extension: lossless conversion to a floating-point type.

Definition at line 111 of file limits.hpp.

Member Function Documentation

◆ denorm_min()

static constexpr fxd::fixed< Int, Frac, Raw > denorm_min ( )
inlinestaticconstexprnoexcept

Same as min() since there are no denormalized values.

Definition at line 206 of file limits.hpp.

◆ epsilon()

static constexpr fxd::fixed< Int, Frac, Raw > epsilon ( )
inlinestaticconstexprnoexcept

Smallest increment.

Definition at line 156 of file limits.hpp.

◆ infinity()

static constexpr fxd::fixed< Int, Frac, Raw > infinity ( )
inlinestaticconstexprnoexcept

Not meaningful, has_infinity is false.

Definition at line 176 of file limits.hpp.

◆ lowest()

static constexpr fxd::fixed< Int, Frac, Raw > lowest ( )
inlinestaticconstexprnoexcept

Closest value to -∞.

Definition at line 127 of file limits.hpp.

◆ max()

static constexpr fxd::fixed< Int, Frac, Raw > max ( )
inlinestaticconstexprnoexcept

Maximum value.

Definition at line 141 of file limits.hpp.

◆ max_pow2()

static constexpr fxd::fixed< Int, Frac, Raw > max_pow2 ( )
inlinestaticconstexprnoexcept

Extension: maximum power of two.

Definition at line 216 of file limits.hpp.

◆ min()

static constexpr fxd::fixed< Int, Frac, Raw > min ( )
inlinestaticconstexprnoexcept

Smallest positive value; same semantics as floating-point.

Definition at line 117 of file limits.hpp.

◆ quiet_NaN()

static constexpr fxd::fixed< Int, Frac, Raw > quiet_NaN ( )
inlinestaticconstexprnoexcept

Not meaningful, has_quiet_NaN is false.

Definition at line 186 of file limits.hpp.

◆ round_error()

static constexpr fxd::fixed< Int, Frac, Raw > round_error ( )
inlinestaticconstexprnoexcept

Maximum possible error.

Definition at line 166 of file limits.hpp.

◆ signaling_NaN()

static constexpr fxd::fixed< Int, Frac, Raw > signaling_NaN ( )
inlinestaticconstexprnoexcept

Not meaningful, has_signaling_NaN is false.

Definition at line 196 of file limits.hpp.

Member Data Documentation

◆ digits

constexpr int digits
staticconstexpr

fxd::fixed::bits - is_signed.

Definition at line 78 of file limits.hpp.

◆ digits10

constexpr int digits10
staticconstexpr

Same estimation used for floating-point.

Definition at line 81 of file limits.hpp.

◆ has_denorm

constexpr float_denorm_style has_denorm = denorm_absent
staticconstexpr

No denormals.

Definition at line 57 of file limits.hpp.

◆ has_denorm_loss

constexpr bool has_denorm_loss = false
staticconstexpr

No denormals.

Definition at line 60 of file limits.hpp.

◆ has_infinity

constexpr bool has_infinity = false
staticconstexpr

No representation for .

Definition at line 48 of file limits.hpp.

◆ has_quiet_NaN

constexpr bool has_quiet_NaN = false
staticconstexpr

No NaN.

Definition at line 51 of file limits.hpp.

◆ has_signaling_NaN

constexpr bool has_signaling_NaN = false
staticconstexpr

No NaN.

Definition at line 54 of file limits.hpp.

◆ is_bounded

constexpr bool is_bounded = numeric_limits<Raw>::is_bounded
staticconstexpr

It's bounded by the underlying integer type.

Definition at line 69 of file limits.hpp.

◆ is_exact

constexpr bool is_exact = true
staticconstexpr

All arithmetic is done with integers, so fxd::fixed is exact.

Definition at line 45 of file limits.hpp.

◆ is_iec559

constexpr bool is_iec559 = false
staticconstexpr

Not a standard floating point type.

Definition at line 66 of file limits.hpp.

◆ is_integer

constexpr bool is_integer = Frac <= 0
staticconstexpr

If this represents integers only.

Definition at line 42 of file limits.hpp.

◆ is_modulo

constexpr bool is_modulo = numeric_limits<Raw>::is_modulo
staticconstexpr

It's modulo if the underlying integer is modulo.

Definition at line 72 of file limits.hpp.

◆ is_signed

constexpr bool is_signed = numeric_limits<Raw>::is_signed
staticconstexpr

Sign depends on the underlying integer type.

Definition at line 39 of file limits.hpp.

◆ is_specialized

constexpr bool is_specialized = true
staticconstexpr

This is a valid specialization.

Definition at line 36 of file limits.hpp.

◆ max_bit

constexpr int max_bit = Int - is_signed
staticconstexpr

Extension: maximum logical bit.

Definition at line 105 of file limits.hpp.

◆ max_digits10

constexpr int max_digits10
staticconstexpr

Same estimation used for floating-point.

Definition at line 84 of file limits.hpp.

◆ max_exponent

constexpr int max_exponent = Int - is_signed
staticconstexpr

Maximum power-of-two that can be stored.

Definition at line 93 of file limits.hpp.

◆ max_exponent10

constexpr int max_exponent10
staticconstexpr

Same estimation used for floating-point.

Definition at line 96 of file limits.hpp.

◆ min_bit

constexpr int min_bit = - Frac
staticconstexpr

Extension: minimum logical bit.

Definition at line 108 of file limits.hpp.

◆ min_exponent

constexpr int min_exponent = 1 - Frac
staticconstexpr

Minimum power-of-two that can be stored.

Definition at line 87 of file limits.hpp.

◆ min_exponent10

constexpr int min_exponent10
staticconstexpr

Same estimation used for floating-point.

Definition at line 90 of file limits.hpp.

◆ radix

constexpr int radix = numeric_limits<Raw>::radix
staticconstexpr

Same radix as the underlying integer.

Definition at line 75 of file limits.hpp.

◆ round_style

constexpr float_round_style round_style = round_toward_zero
staticconstexpr

Default rounding is towards zero, just like with integers.

Definition at line 63 of file limits.hpp.

◆ tinyness_before

constexpr bool tinyness_before = false
staticconstexpr

Not meaningful.

Definition at line 102 of file limits.hpp.

◆ traps

constexpr bool traps = numeric_limits<Raw>::traps
staticconstexpr

Depends on the underlying integer.

Definition at line 99 of file limits.hpp.


The documentation for this struct was generated from the following file: