|
|
using | NL = std::numeric_limits< Float > |
| |
|
using | Uint = typename std::conditional< is_single, uint32_t, uint64_t >::type |
| |
|
|
constexpr | IEEEFloat (Float value_) |
| |
|
constexpr | IEEEFloat (Uint bits_) |
| |
|
constexpr | IEEEFloat (Uint exponent, Uint significand) |
| |
|
constexpr Uint | ExponentBits () const |
| |
|
constexpr Uint | SignificandBits () const |
| |
|
constexpr bool | IsNegative () const |
| |
|
bool | IsZero () const |
| |
|
bool | IsDenormal () const |
| |
|
bool | IsNaN () const |
| |
|
bool | IsInf () const |
| |
|
Float | Abs () const |
| |
|
|
union { |
|
Float value |
| |
|
Uint bits |
| |
| }; | |
| |
|
|
static constexpr bool const | is_single = (NL::digits == 24) && (NL::max_exponent) == 128 |
| |
|
static constexpr bool const | is_double = (NL::digits == 53) && (NL::max_exponent == 1024) |
| |
|
static constexpr unsigned const | kPrecision = is_single ? 24 : 53 |
| |
|
static constexpr unsigned const | kSignificandLen = kPrecision - 1 |
| |
|
static constexpr unsigned const | kMaxExponent = is_single ? 0xFF : 0x7FF |
| |
|
static constexpr unsigned const | kExponentBias = kMaxExponent / 2 |
| |
|
static constexpr Uint const | kHiddenBit = Uint{1} << kSignificandLen |
| |
|
static constexpr Uint const | kSignMask = Uint{1} << (is_single ? 31 : 63) |
| |
|
static constexpr Uint const | kExponentMask = Uint{kMaxExponent} << kSignificandLen |
| |
|
static constexpr Uint const | kSignificandMask = kHiddenBit - 1 |
| |
template<typename Float>
struct util::IEEEFloat< Float >
Definition at line 31 of file ieeefloat.h.
The documentation for this struct was generated from the following file: