Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cFloat32 Class Reference

#include <cFloat.h>

Inheritance diagram for Gray::cFloat32:
GrayLib::cFloatEst

Public Member Functions

 cFloat32 () noexcept
 
 cFloat32 (float f) noexcept
 
void put_Bits (UINT32 dw) noexcept
 
UINT32 get_Mantissa () const noexcept
 

Static Public Member Functions

static UINT32 toBits (float src) noexcept
 
static float fromBits (UINT32 src) noexcept
 

Public Attributes

cUnion32 m_v
 holds the float32. More...
 

Static Public Attributes

static const UINT32 k_uOne = 0x3f800000
 (UINT32) = float 1.0f (8 bit exponent) More...
 
static const UINT32 k_uTwo = 0x40000000
 (UINT32) = float 2.0f More...
 
static const UINT32 k_SIGN_MASK = 0x80000000
 1 bit = value sign (Sign_bit) More...
 
static const UINT32 k_EXP_MASK = 0x7f800000
 8 bits = signed exponent (base 2) More...
 
static const UINT32 k_MANT_MASK = 0x007fffff
 23 bits = fractional mantissa = FLT_MANT_DIG More...
 
static const UINT32 k_MANT_BITS = 23
 23 bits = fractional mantissa = FLT_MANT_DIG More...
 

Friends

class cFloatTests
 

Detailed Description

pack/unpack IEEE float32/float http://en.wikipedia.org/wiki/IEEE_754-1985 Use FLT_MAX

Constructor & Destructor Documentation

◆ cFloat32() [1/2]

Gray::cFloat32::cFloat32 ( )
inlinenoexcept

◆ cFloat32() [2/2]

Gray::cFloat32::cFloat32 ( float  f)
inlinenoexcept

Member Function Documentation

◆ fromBits()

static float Gray::cFloat32::fromBits ( UINT32  src)
inlinestaticnoexcept

reinterpret an UINT32 as a float assuming IEEE 32 Warning in GNUC reinterpret_ warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

◆ get_Mantissa()

UINT32 Gray::cFloat32::get_Mantissa ( ) const
inlinenoexcept

◆ put_Bits()

void Gray::cFloat32::put_Bits ( UINT32  dw)
inlinenoexcept

◆ toBits()

static UINT32 Gray::cFloat32::toBits ( float  src)
inlinestaticnoexcept

reinterpret a float as an UINT32 assuming IEEE 32 Warning in GNUC reinterpret_ warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Friends And Related Function Documentation

◆ cFloatTests

friend class cFloatTests
friend

Member Data Documentation

◆ k_EXP_MASK

const UINT32 Gray::cFloat32::k_EXP_MASK = 0x7f800000
static

8 bits = signed exponent (base 2)

◆ k_MANT_BITS

const UINT32 Gray::cFloat32::k_MANT_BITS = 23
static

23 bits = fractional mantissa = FLT_MANT_DIG

◆ k_MANT_MASK

const UINT32 Gray::cFloat32::k_MANT_MASK = 0x007fffff
static

23 bits = fractional mantissa = FLT_MANT_DIG

◆ k_SIGN_MASK

const UINT32 Gray::cFloat32::k_SIGN_MASK = 0x80000000
static

1 bit = value sign (Sign_bit)

◆ k_uOne

const UINT32 Gray::cFloat32::k_uOne = 0x3f800000
static

(UINT32) = float 1.0f (8 bit exponent)

◆ k_uTwo

const UINT32 Gray::cFloat32::k_uTwo = 0x40000000
static

(UINT32) = float 2.0f

◆ m_v

cUnion32 Gray::cFloat32::m_v

holds the float32.


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