#include <hps.h>

Static Public Member Functions

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 float C2F (unsigned char x)
 
static HPS_INLINE bool Equals (float const &a, float const &b, int tolerance=32)
 
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 uint32_t extract_uint32_t (float const &a)
 
static HPS_INLINE void inject_uint32_t (float &a, uint32_t const &i)
 
static HPS_INLINE bool IsAbnormal (float const &a)
 
static HPS_INLINE bool IsAbnormal (double const &a)
 
static HPS_INLINE bool IsInfinite (float const &a)
 
static HPS_INLINE bool IsInfinite (double const &a)
 
static HPS_INLINE bool IsNAN (float const &a)
 
static HPS_INLINE bool IsNAN (double const &a)
 
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 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 replace_if_larger (float &a, float const &b)
 
static HPS_INLINE void replace_if_larger (double &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 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 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
 
static const float NegativeInfinity
 

Detailed Description

The Float class is a concept class that exposes a number of useful utilities for working with floating point numbers.

Member Function Documentation

◆ Equals()

HPS_INLINE bool HPS::Float::Equals ( float const &  a,
float const &  b,
int  tolerance = 32 
)
static

Checks two floats for equality within a specified tolerance. The tolerance is specified in float increments that scale with the floats themselves.

◆ IsAbnormal()

static HPS_INLINE bool HPS::Float::IsAbnormal ( float const &  a)
inlinestatic

See if the value is not "normal" (infinite or NaN)

◆ IsInfinite()

static HPS_INLINE bool HPS::Float::IsInfinite ( float const &  a)
inlinestatic

See if the value is either infinity

◆ IsNAN()

static HPS_INLINE bool HPS::Float::IsNAN ( float const &  a)
inlinestatic

See if the value is Not-A-Number

Member Data Documentation

◆ Infinity

const float HPS::Float::Infinity
static

The 32-bit float representation of infinity.

◆ NegativeInfinity

const float HPS::Float::NegativeInfinity
static

The 32-bit float representation of negative infinity.


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