The Float class is a concept class that exposes a number of useful utilities for working with floating point numbers. More...
#include <hps.h>
Static Public Member Functions | |
static HPS_INLINE bool | IsInfinite (float const &a) |
See if the value is either infinity. More... | |
static HPS_INLINE bool | IsInfinite (double const &a) |
static HPS_INLINE bool | IsNAN (float const &a) |
See if the value is Not-A-Number. More... | |
static HPS_INLINE bool | IsNAN (double const &a) |
static HPS_INLINE bool | IsAbnormal (float const &a) |
See if the value is not "normal" (infinite or NaN) More... | |
static HPS_INLINE bool | IsAbnormal (double const &a) |
static HPS_INLINE bool | Equals (float const &a, float const &b, int tolerance=32) |
Checks two floats for equality within a specified tolerance. More... | |
static HPS_INLINE bool | Equals (double const &a, double const &b, int tolerance=32) |
template<typename Alloc > | |
static HPS_INLINE bool | Equals (std::vector< float, Alloc > const &a, std::vector< float, Alloc > const &b, int tolerance=32) |
static HPS_INLINE uint32_t | extract_sign_bit (float const &a) |
static HPS_INLINE uint32_t | extract_sign_bit (double const &a) |
static HPS_INLINE void | apply_sign_bit (float &a, uint32_t const &sign_bit) |
static HPS_INLINE void | apply_sign_bit (double &a, uint32_t const &sign_bit) |
static HPS_INLINE unsigned char | unit_to_byte (float const &a) |
static HPS_INLINE unsigned char | unit_to_byte_scaled (float const &a, unsigned char mix) |
static HPS_INLINE bool | match (float const &a, float const &b) |
static HPS_INLINE bool | match (double const &a, double const &b) |
static HPS_INLINE void | replace_if_smaller (float &a, float const &b) |
static HPS_INLINE void | replace_if_smaller (double &a, double const &b) |
static HPS_INLINE void | replace_if_larger (float &a, float const &b) |
static HPS_INLINE void | replace_if_larger (double &a, double const &b) |
static HPS_INLINE uint32_t | extract_uint32_t (float const &a) |
static HPS_INLINE void | inject_uint32_t (float &a, uint32_t const &i) |
static HPS_INLINE float | C2F (unsigned char x) |
static HPS_INLINE void | pack_4 (float const &f, float *m) |
static HPS_INLINE void | pack_4 (float const &f0, float const &f1, float const &f2, float const &f3, float *m) |
static HPS_INLINE void | unpack_4 (float *f0, float const *const m) |
static HPS_INLINE void | unpack_4 (float &f0, float &f1, float &f2, float &f3, float const *const m) |
Static Public Attributes | |
static const float | Infinity |
The 32-bit float representation of infinity. More... | |
static const float | NegativeInfinity |
The 32-bit float representation of negative infinity. More... | |
Private Types | |
enum | Parts { Low, High } |
Private Member Functions | |
Float () | |
Static Private Member Functions | |
static HPS_INLINE bool | is_infinite (int32_t const &v) |
static HPS_INLINE bool | is_infinite (uint32_t const &v) |
static HPS_INLINE bool | is_infinite (int32_t const *v) |
static HPS_INLINE bool | is_infinite (uint32_t const *v) |
static HPS_INLINE bool | is_nan (int32_t const &v) |
static HPS_INLINE bool | is_nan (uint32_t const &v) |
static HPS_INLINE bool | is_nan (int32_t const *v) |
static HPS_INLINE bool | is_nan (uint32_t const *v) |
static HPS_INLINE bool | is_special (int32_t const &v) |
static HPS_INLINE bool | is_special (uint32_t const &v) |
static HPS_INLINE bool | is_special (int32_t const *v) |
static HPS_INLINE bool | is_special (uint32_t const *v) |
Static Private Attributes | |
static const float | char_to_float [256] |
The Float class is a concept class that exposes a number of useful utilities for working with floating point numbers.
|
private |
|
private |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
Checks two floats for equality within a specified tolerance.
The tolerance is specified in float increments that scale with the floats themselves.
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestatic |
See if the value is not "normal" (infinite or NaN)
|
inlinestatic |
|
inlinestatic |
See if the value is either infinity.
|
inlinestatic |
|
inlinestatic |
See if the value is Not-A-Number.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
staticprivate |
|
static |
The 32-bit float representation of infinity.
|
static |
The 32-bit float representation of negative infinity.