BurgerLib
Static Public Member Functions | Static Private Attributes
Burger::FPMath Class Reference

Generic floating point math routines. More...

#include <fpfloat.h>

List of all members.

Static Public Member Functions

static double BURGER_INLINE DoubleInf (void)
 Constant for Infinity in the double format.
static double BURGER_INLINE DoubleNan (void)
 Constant for Not a Number (NaN) in the double format.
static double BURGER_INLINE DoubleMin (void)
 Constant for the smallest number (Non-zero) in the double format.
static double BURGER_INLINE DoubleMax (void)
 Constant for the largest number in the double format.
static double BURGER_INLINE DoubleEpsilon (void)
 Constant for Epsilon in the double format.
static float BURGER_INLINE SingleInf (void)
 Constant for Infinity in the float format.
static float BURGER_INLINE SingleNan (void)
 Constant for Not a Number (NaN) in the float format.
static float BURGER_INLINE SingleMin (void)
 Constant for the smallest number (Non-zero) in the float format.
static float BURGER_INLINE SingleMax (void)
 Constant for the largest number in the float format.
static float BURGER_INLINE SingleEpsilon (void)
 Constant for Epsilon in the float format.
static float BURGER_API Abs (float fInput)
 Get the absolute value of a float.
static double BURGER_API Abs (double dInput)
 Get the absolute value of a double.
static float BURGER_API Sqrt (float fInput)
static double BURGER_API Sqrt (double dInput)
static float BURGER_INLINE FromInt (Int32 iInput)
static float BURGER_INLINE FromFixed (Fixed32 fInput)
static float BURGER_INLINE FromInt (const Int32 *pInput)
static float BURGER_INLINE FromFixed (const Fixed32 *pInput)
static void BURGER_INLINE FromInt (float *pOutput, Int32 iInput)
static void BURGER_INLINE FromFixed (float *pOutput, Fixed32 fInput)
static void BURGER_INLINE FromInt (float *pOutput, const Int32 *pInput)
static void BURGER_INLINE FromFixed (float *pOutput, const Fixed32 *pInput)
static float BURGER_API Floor (float fInput)
static float BURGER_API Ceil (float fInput)

Static Private Attributes

static const Word64 DoubleInf64 = 0x7FF0000000000000LL
 Constant for Infinity in the double format.
static const Word64 DoubleNan64 = 0x7FFFFFFFFFFFFFFFLL
 Constant for Not a Number (NaN) in the double format.
static const Word64 DoubleMin64 = 0x0010000000000000LL
 Constant for the smallest number (Non-zero) in the double format.
static const Word64 DoubleMax64 = 0x7FEFFFFFFFFFFFFFLL
 Constant for the largest number in the double format.
static const Word64 DoubleEpsilon64 = 0x3CB0000000000000LL
 Constant for Epsilon in the double format.
static const Word32 SingleInf32 = 0x7F800000
 Constant for Infinity in the float format.
static const Word32 SingleNan32 = 0x7FFFFFFF
 Constant for Not a Number (NaN) in the float format.
static const Word32 SingleMin32 = 0x00800000
 Constant for smallest number (Non-zero) in the float format.
static const Word32 SingleMax32 = 0x7F7FFFFF
 Constant for largest number in the float format.
static const Word32 SingleEpsilon32 = 0x34000000
 Constant for Epsilon in the float format.

Detailed Description

Generic floating point math routines.

These functions will create and manipulate floating point numbers. Many Burgerlib math routines call these functions for low level computations and constants. It is meant to be a stable cross-platform way of handling math without having to worry if there are subtle differences from the ANSI class libraries between different vendor's libraries.


Member Function Documentation

float BURGER_API Burger::FPMath::Abs ( float  fInput) [static]

Get the absolute value of a float.

Return the absolute value of the floating point input. This is usually done by inline assembly.

Parameters:
fInputA valid single precision fp number.
Returns:
The absolute value of the input.
double BURGER_API Burger::FPMath::Abs ( double  dInput) [static]

Get the absolute value of a double.

Return the absolute value of the floating point input. This is usually done by inline assembly.

Parameters:
dInputA valid double precision fp number.
Returns:
The absolute value of the input.
static float BURGER_API Burger::FPMath::Ceil ( float  fInput) [static]
double Burger::FPMath::DoubleEpsilon ( void  ) [inline, static]

Constant for Epsilon in the double format.

Returns:
Positive epsilon for a double.
double Burger::FPMath::DoubleInf ( void  ) [inline, static]

Constant for Infinity in the double format.

Returns:
Positive infinity as a double.
double Burger::FPMath::DoubleMax ( void  ) [inline, static]

Constant for the largest number in the double format.

Returns:
Largest positive number possible for a double.
double Burger::FPMath::DoubleMin ( void  ) [inline, static]

Constant for the smallest number (Non-zero) in the double format.

Returns:
Smallest positive number possible for a double.
double Burger::FPMath::DoubleNan ( void  ) [inline, static]

Constant for Not a Number (NaN) in the double format.

Returns:
Positive NaN as a double.
static float BURGER_API Burger::FPMath::Floor ( float  fInput) [static]
static float BURGER_INLINE Burger::FPMath::FromFixed ( Fixed32  fInput) [inline, static]
static float BURGER_INLINE Burger::FPMath::FromFixed ( const Fixed32 pInput) [inline, static]
static void BURGER_INLINE Burger::FPMath::FromFixed ( float *  pOutput,
Fixed32  fInput 
) [inline, static]
static void BURGER_INLINE Burger::FPMath::FromFixed ( float *  pOutput,
const Fixed32 pInput 
) [inline, static]
static float BURGER_INLINE Burger::FPMath::FromInt ( Int32  iInput) [inline, static]
static float BURGER_INLINE Burger::FPMath::FromInt ( const Int32 pInput) [inline, static]
static void BURGER_INLINE Burger::FPMath::FromInt ( float *  pOutput,
Int32  iInput 
) [inline, static]
static void BURGER_INLINE Burger::FPMath::FromInt ( float *  pOutput,
const Int32 pInput 
) [inline, static]
float Burger::FPMath::SingleEpsilon ( void  ) [inline, static]

Constant for Epsilon in the float format.

Returns:
Positive epsilon for a float.
float Burger::FPMath::SingleInf ( void  ) [inline, static]

Constant for Infinity in the float format.

Returns:
Positive infinity as a float.
float Burger::FPMath::SingleMax ( void  ) [inline, static]

Constant for the largest number in the float format.

Returns:
Largest positive number possible for a float.
float Burger::FPMath::SingleMin ( void  ) [inline, static]

Constant for the smallest number (Non-zero) in the float format.

Returns:
Smallest positive number possible for a float.
float Burger::FPMath::SingleNan ( void  ) [inline, static]

Constant for Not a Number (NaN) in the float format.

Returns:
Positive NaN as a float.
float BURGER_API Burger::FPMath::Sqrt ( float  fInput) [static]
double BURGER_API Burger::FPMath::Sqrt ( double  dInput) [static]

Member Data Documentation

const Word64 Burger::FPMath::DoubleEpsilon64 = 0x3CB0000000000000LL [static, private]

Constant for Epsilon in the double format.

const Word64 Burger::FPMath::DoubleInf64 = 0x7FF0000000000000LL [static, private]

Constant for Infinity in the double format.

const Word64 Burger::FPMath::DoubleMax64 = 0x7FEFFFFFFFFFFFFFLL [static, private]

Constant for the largest number in the double format.

const Word64 Burger::FPMath::DoubleMin64 = 0x0010000000000000LL [static, private]

Constant for the smallest number (Non-zero) in the double format.

const Word64 Burger::FPMath::DoubleNan64 = 0x7FFFFFFFFFFFFFFFLL [static, private]

Constant for Not a Number (NaN) in the double format.

const Word32 Burger::FPMath::SingleEpsilon32 = 0x34000000 [static, private]

Constant for Epsilon in the float format.

const Word32 Burger::FPMath::SingleInf32 = 0x7F800000 [static, private]

Constant for Infinity in the float format.

const Word32 Burger::FPMath::SingleMax32 = 0x7F7FFFFF [static, private]

Constant for largest number in the float format.

const Word32 Burger::FPMath::SingleMin32 = 0x00800000 [static, private]

Constant for smallest number (Non-zero) in the float format.

const Word32 Burger::FPMath::SingleNan32 = 0x7FFFFFFF [static, private]

Constant for Not a Number (NaN) in the float format.