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

#include <cFloatEst.h>

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

Public Member Functions

 UNITTEST_FRIEND (cFloatEst)
 
- Public Member Functions inherited from Gray::cFloat32
 cFloat32 () noexcept
 
 cFloat32 (float f) noexcept
 
void put_Bits (UINT32 dw) noexcept
 
UINT32 get_Mantissa () const noexcept
 

Static Public Member Functions

static float Sqrt (float n) noexcept
 
static float pow2 (int iPow)
 
static int ifloor_log2 (float x)
 
static int iceil_log2 (float x)
 
static int ifloor (float f)
 
static int iceil (float f)
 
static bool IsInteger (float f)
 
- Static Public Member Functions inherited from Gray::cFloat32
static UINT32 toBits (float src) noexcept
 
static float fromBits (UINT32 src) noexcept
 

Additional Inherited Members

- Public Attributes inherited from Gray::cFloat32
cUnion32 m_v
 holds the float32. More...
 
- Static Public Attributes inherited from Gray::cFloat32
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...
 

Detailed Description

fast float32 estimation helpers Use FLT_MAX

Member Function Documentation

◆ iceil()

static int GrayLib::cFloatEst::iceil ( float  f)
inlinestatic

◆ iceil_log2()

static int GrayLib::cFloatEst::iceil_log2 ( float  x)
inlinestatic

◆ ifloor()

static int GrayLib::cFloatEst::ifloor ( float  f)
inlinestatic

◆ ifloor_log2()

static int GrayLib::cFloatEst::ifloor_log2 ( float  x)
inlinestatic

◆ IsInteger()

static bool GrayLib::cFloatEst::IsInteger ( float  f)
inlinestatic

◆ pow2()

static float GrayLib::cFloatEst::pow2 ( int  iPow)
inlinestatic

like powf(2, iPow) fast approximation 32 bit float.

◆ Sqrt()

static float GrayLib::cFloatEst::Sqrt ( float  n)
inlinestaticnoexcept

Fast but not very accurate square root approximation trick. like sqrtf(x) 32 bit float.

◆ UNITTEST_FRIEND()

GrayLib::cFloatEst::UNITTEST_FRIEND ( cFloatEst  )

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