Nebula
Loading...
Searching...
No Matches
Math::half Class Reference

#include <half.h>

Classes

union  Float
 

Public Member Functions

 half ()
 Constructor.
 
 half (const half &h)
 Construct from other half.
 
 half (const float f)
 Construct from float.
 
 operator float () const
 Convert to float.
 
bool operator== (const half rhs) const
 Compare equals.
 
bool operator== (const float rhs) const
 Compare equals.
 
bool operator!= (const half rhs) const
 Compare not equals.
 
bool operator!= (const float rhs) const
 Compare not equals.
 
bool operator< (const half rhs) const
 Compare less.
 
bool operator< (const float rhs) const
 Compare less.
 
bool operator<= (const half rhs) const
 Compare less equals.
 
bool operator<= (const float rhs) const
 Compare less equals.
 
bool operator> (const half rhs) const
 Compare greater.
 
bool operator> (const float rhs) const
 Compare greater.
 
bool operator>= (const half rhs) const
 Compare greater equals.
 
bool operator>= (const float rhs) const
 Compare greater equals.
 
halfoperator+= (half other)
 
halfoperator-= (half other)
 
halfoperator*= (half other)
 
halfoperator/= (half other)
 
half operator- () const
 

Private Attributes

union { 
 
   uint16_t   bits 
 
   struct { 
 
      uint16_t   frac: 10 
 
      uint16_t   exp: 5 
 
      uint16_t   sign: 1 
 
   }   ieee 
 
};  
 

Static Private Attributes

static const uint8_t BITS_MANTISSA = 10
 
static const uint8_t BITS_EXPONENT = 5
 
static const uint8_t MAX_EXPONENT_VALUE = 31
 
static const uint8_t BIAS = MAX_EXPONENT_VALUE / 2
 
static const uint8_t MAX_EXPONENT = BIAS
 
static const uint8_t MIN_EXPONENT = -BIAS
 
static const uint8_t MAX_EXPONENT10 = 9
 
static const uint8_t MIN_EXPONENT10 = -9
 

Friends

class std::numeric_limits< Math::half >
 

Constructor & Destructor Documentation

◆ half() [1/3]

Math::half::half ( )
inline

Constructor.

◆ half() [2/3]

Math::half::half ( const half & h)
inline

Construct from other half.

◆ half() [3/3]

Math::half::half ( const float f)
inline

Construct from float.

Member Function Documentation

◆ operator float()

Math::half::operator float ( ) const
inline

Convert to float.

◆ operator!=() [1/2]

bool Math::half::operator!= ( const float rhs) const
inline

Compare not equals.

◆ operator!=() [2/2]

bool Math::half::operator!= ( const half rhs) const
inline

Compare not equals.

◆ operator*=()

half & Math::half::operator*= ( half other)
inline

◆ operator+=()

half & Math::half::operator+= ( half other)
inline

◆ operator-()

half Math::half::operator- ( ) const
inline

◆ operator-=()

half & Math::half::operator-= ( half other)
inline

◆ operator/=()

half & Math::half::operator/= ( half other)
inline

◆ operator<() [1/2]

bool Math::half::operator< ( const float rhs) const
inline

Compare less.

◆ operator<() [2/2]

bool Math::half::operator< ( const half rhs) const
inline

Compare less.

◆ operator<=() [1/2]

bool Math::half::operator<= ( const float rhs) const
inline

Compare less equals.

◆ operator<=() [2/2]

bool Math::half::operator<= ( const half rhs) const
inline

Compare less equals.

◆ operator==() [1/2]

bool Math::half::operator== ( const float rhs) const
inline

Compare equals.

◆ operator==() [2/2]

bool Math::half::operator== ( const half rhs) const
inline

Compare equals.

◆ operator>() [1/2]

bool Math::half::operator> ( const float rhs) const
inline

Compare greater.

◆ operator>() [2/2]

bool Math::half::operator> ( const half rhs) const
inline

Compare greater.

◆ operator>=() [1/2]

bool Math::half::operator>= ( const float rhs) const
inline

Compare greater equals.

◆ operator>=() [2/2]

bool Math::half::operator>= ( const half rhs) const
inline

Compare greater equals.

Friends And Related Symbol Documentation

◆ std::numeric_limits< Math::half >

friend class std::numeric_limits< Math::half >
friend

Member Data Documentation

◆ [union]

union { ... } Math::half

◆ BIAS

const uint8_t Math::half::BIAS = MAX_EXPONENT_VALUE / 2
staticprivate

◆ bits

uint16_t Math::half::bits

◆ BITS_EXPONENT

const uint8_t Math::half::BITS_EXPONENT = 5
staticprivate

◆ BITS_MANTISSA

const uint8_t Math::half::BITS_MANTISSA = 10
staticprivate

◆ exp

uint16_t Math::half::exp

◆ frac

uint16_t Math::half::frac

◆ [struct]

struct { ... } Math::half::ieee

◆ MAX_EXPONENT

const uint8_t Math::half::MAX_EXPONENT = BIAS
staticprivate

◆ MAX_EXPONENT10

const uint8_t Math::half::MAX_EXPONENT10 = 9
staticprivate

◆ MAX_EXPONENT_VALUE

const uint8_t Math::half::MAX_EXPONENT_VALUE = 31
staticprivate

◆ MIN_EXPONENT

const uint8_t Math::half::MIN_EXPONENT = -BIAS
staticprivate

◆ MIN_EXPONENT10

const uint8_t Math::half::MIN_EXPONENT10 = -9
staticprivate

◆ sign

uint16_t Math::half::sign

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