|
| FPInfo (void) noexcept |
| Default constructor.
|
|
| FPInfo (uint16_t uValue) noexcept |
| Constructor for 16 bit float.
|
|
| FPInfo (float fValue) noexcept |
| Constructor for 32 bit float.
|
|
| FPInfo (double dValue) noexcept |
| Constructor for 64 bit float.
|
|
void | init_half (uint16_t uValue) noexcept |
| Process a 16 bit floating point number.
|
|
void | init_float (float fValue) noexcept |
| Process a 32 bit floating point number.
|
|
void | init_double (double dValue) noexcept |
| Process a 64 bit floating point number.
|
|
uint64_t | get_mantissa (void) const noexcept |
| Get the mantissa value.
|
|
uint32_t | get_biased_exponent (void) const noexcept |
| Get the biased exponent.
|
|
int32_t | get_exponent (void) const noexcept |
| Get the exponent.
|
|
uint32_t | get_mantissa_bit_count (void) const noexcept |
| Get the number of bits in the mantissa.
|
|
uint32_t | get_exponent_bit_count (void) const noexcept |
| Get the number of bits in the exponent.
|
|
uint_t | is_valid (void) const noexcept |
| Detect if a number was analyzed.
|
|
uint_t | is_negative (void) const noexcept |
| Detect if a number is a negative value.
|
|
uint_t | is_zero (void) const noexcept |
| Detect if a number is zero.
|
|
uint_t | is_NaN (void) const noexcept |
| Detect if a number is Not a Number.
|
|
uint_t | is_QNaN (void) const noexcept |
| Detect if a number is a quiet Not a Number.
|
|
uint_t | is_indefinite_NaN (void) const noexcept |
| Detect if a number is an indefinite Not a Number.
|
|
uint_t | is_infinity (void) const noexcept |
| Detect if a number is infinity.
|
|
uint_t | is_subnormal (void) const noexcept |
| Detect if a number is a non normalized number.
|
|
uint_t | is_finite (void) const noexcept |
| Detect if a number is a finite number.
|
|
FPInfo & | operator= (uint16_t usValue) noexcept |
| Process a 16 bit floating point number.
|
|
FPInfo & | operator= (float fValue) noexcept |
| Process a 32 bit floating point number.
|
|
FPInfo & | operator= (double dValue) noexcept |
| Process a 64 bit floating point number.
|
|
|
static constexpr const uint32_t | kSignBit16 = 0x8000U |
| Location of the sign bit in a 16 bit float.
|
|
static constexpr const uint32_t | kExponentMask16 = 0x7C00U |
| Mask for the exponent in a 16 bit float.
|
|
static constexpr const uint32_t | kMantissaMask16 = 0x03FFU |
| Mask for the mantissa in a 16 bit float.
|
|
static constexpr const uint32_t | kImplicitBit16 = 0x0400U |
| Implicit "1" bit for a 16 bit float.
|
|
static constexpr const uint32_t | kMantissaBitCount16 = 10 |
| Number of bits in the mantissa for a 16 bit float.
|
|
static constexpr const uint32_t | kExponentBitCount16 = 5 |
| Number of bits in the exponent for a 16 bit float.
|
|
static constexpr const uint32_t | kExponentBias16 = 15 |
| Bias of the exponent for a 16 bit float.
|
|
static constexpr const uint32_t | kSpecialExponent16 = 0x1FU |
| Special exponent for INF/NAN in a 16 bit float.
|
|
static constexpr const uint32_t | kNANTypeBit16 = 0x0200U |
| QNAN or SNAN bit in a 16 bit float.
|
|
static constexpr const uint32_t | kSignBit32 = 0x80000000U |
| Location of the sign bit in a 32 bit float.
|
|
static constexpr const uint32_t | kExponentMask32 = 0x7F800000U |
| Mask for the exponent in a 32 bit float.
|
|
static constexpr const uint32_t | kMantissaMask32 = 0x007FFFFFU |
| Mask for the mantissa in a 32 bit float.
|
|
static constexpr const uint32_t | kImplicitBit32 = 0x00800000U |
| Implicit "1" bit for a 32 bit float.
|
|
static constexpr const uint32_t | kMantissaBitCount32 = 23 |
| Number of bits in the mantissa for a 32 bit float.
|
|
static constexpr const uint32_t | kExponentBitCount32 = 8 |
| Number of bits in the exponent for a 32 bit float.
|
|
static constexpr const uint32_t | kExponentBias32 = 127 |
| Bias of the exponent for a 32 bit float.
|
|
static constexpr const uint32_t | kSpecialExponent32 = 0xFFU |
| Special exponent for INF/NAN in a 32 bit float.
|
|
static constexpr const uint32_t | kNANTypeBit32 = 0x00400000U |
| QNAN or SNAN bit in a 32 bit float.
|
|
static constexpr const uint64_t | kSignBit64 = 0x8000000000000000ULL |
| Location of the sign bit in a 64 bit float.
|
|
static constexpr const uint64_t | kExponentMask64 |
| Mask for the exponent in a 64 bit float.
|
|
static constexpr const uint64_t | kMantissaMask64 |
| Mask for the mantissa in a 64 bit float.
|
|
static constexpr const uint64_t | kImplicitBit64 |
| Implicit "1" bit for a 64 bit float.
|
|
static constexpr const uint32_t | kMantissaBitCount64 = 52 |
| Number of bits in the mantissa for a 64 bit float.
|
|
static constexpr const uint32_t | kExponentBitCount64 = 11 |
| Number of bits in the exponent for a 64 bit float.
|
|
static constexpr const uint32_t | kExponentBias64 = 1023 |
| Bias of the exponent for a 64 bit float.
|
|
static constexpr const uint32_t | kSpecialExponent64 = 0x7FFU |
| Special exponent for INF/NAN in a 64 bit float.
|
|
static constexpr const uint64_t | kNANTypeBit64 |
| QNAN or SNAN bit in a 64 bit float.
|
|
static constexpr const uint32_t | kFlagValidShift = 0U |
| Flag that's set if a floating point number was analyzed.
|
|
static constexpr const uint32_t | kFlagNegativeShift = 1U |
| Flag that's set if the number is negative.
|
|
static constexpr const uint32_t | kFlagZeroShift = 2U |
| Flag that's set if the number is zero.
|
|
static constexpr const uint32_t | kFlagNANShift = 3U |
| Flag that's set if the number is a "Not a Number".
|
|
static constexpr const uint32_t | kFlagQNANShift = 4U |
| Flag that's set if the number is a quiet "Not a Number".
|
|
static constexpr const uint32_t | kFlagIndefiniteNANShift = 5U |
| Flag that's set if the number is an unknown "Not a Number".
|
|
static constexpr const uint32_t | kFlagInfinityShift = 6U |
| Flag that's set if the number is infinite.
|
|
static constexpr const uint32_t | kFlagSubNormalShift = 7U |
| Flag that's set if the number is not normalized.
|
|
Class for analyzing a floating point number.
Submitting a number into this class causes it to be broken down into its components so it can be queried as to the floating point behaviors this number represents.
It's useful for printing functions or number analysis functions.
For lightweight tests, use the explicit calls such at is_NaN(float), is_infinite(double), etc
When a floating point number is assigned to this class, it is broken down to the type of value (Infinity, NaN, Subnormal), the mantissa, the exponent and the sign. The values can be accessed with the calls get_mantissa(), get_exponent(), get_mantissa_bit_count(), etc.
- See also
- is_NaN(float), is_NaN(), get_mantissa(), get_exponent()