|
template<typename TYPE > |
static int | Sign (TYPE a) |
|
template<typename TYPE > |
static bool | IsInRange (TYPE n, TYPE low, TYPE high) noexcept |
|
template<typename TYPE > |
static bool | IsInBetween (TYPE n, TYPE a, TYPE b) noexcept |
|
template<typename TYPE > |
static TYPE | Min (TYPE a, TYPE b) noexcept |
|
template<typename TYPE > |
static TYPE | Max (TYPE a, TYPE b) noexcept |
|
template<typename TYPE > |
static TYPE | Max3 (TYPE a, TYPE b, TYPE c) noexcept |
|
template<typename TYPE > |
static TYPE | Clamp (TYPE value, TYPE low, TYPE high) |
|
template<typename TYPE > |
static void | ClampRef (TYPE &rValue, TYPE low, TYPE high) |
|
template<typename TYPE > |
static bool | IsNear (TYPE n1, TYPE n2, TYPE nDiff=(TYPE) k_FLT_MIN2) noexcept |
|
template<typename TYPE > |
static TYPE | Sqr (TYPE a) noexcept |
|
template<typename TYPE > |
static TYPE | Abs (TYPE a) noexcept |
| similar to ABS(n) macro. Does nothing for unsigned types. More...
|
|
template<typename TYPE > |
static TYPE | Mod (TYPE a, TYPE b) |
| a modulus b = remainder of a/b More...
|
|
template<typename TYPE > |
static TYPE | Wrap (TYPE nVal, TYPE nMod) |
|
static bool | IsSignDiff (int a, int b) noexcept |
|
template<typename TYPE > |
static TYPE | GetGreatestCommonDivisor (TYPE x, TYPE y) |
|
template<typename TYPE > |
static TYPE | MulDiv (TYPE a, TYPE b, TYPE c) |
|
template<typename TYPE > |
static TYPE | DivideUp (TYPE a, TYPE b) |
|
template<typename TYPE > |
static TYPE | AddC (TYPE a, TYPE b, bool &bCarry) noexcept |
|
template<typename TYPE > |
static TYPE | SubC (TYPE a, TYPE b, bool &bBorrow) noexcept |
|
template<typename TYPE > |
static bool | ToBool (TYPE nVal) noexcept |
|
static int GRAYCALL | Log2Est (UINT iVal) |
|
static Percent10_t GRAYCALL | GetSCurve (int iValDiff, int iValVarianceHalf) |
|
static Percent10_t GRAYCALL | GetBellCurve (int iValDiff, int iValVarianceHalf) |
|
template<> |
float | Abs (float a) noexcept |
|
template<> |
float | Mod (float a, float b) |
|
template<> |
double | Abs (double a) noexcept |
|
template<> |
double | Mod (double a, double b) |
|
template<> |
int | Abs (int a) noexcept |
|
template<> |
int | Mod (int a, int b) |
|
template<> |
UINT | Abs (UINT a) noexcept |
|
template<> |
UINT | Mod (UINT a, UINT b) |
|
template<> |
UINT16 | MulDiv (UINT16 a, UINT16 b, UINT16 c) |
|
Basic (non floating point) math calculations. works with integer or float/double numbers.
Produce a simple log curve as a percent chance that something could happen.
//! 50+
//! |
//! |
//! |
//! 25| +
//! |
//! | +
//! | +
//! 0 --+--+--+--+------
//! iVar iValDiff
//!
@arg
iValDiff = (-100 to +100) Given a value relative to 0
0 = 50.0% chance.
iValVarianceHalf = the 25.0% point of the bell curve. Similar to Standard Deviation.
@return
(0-100.0) % chance at this iValDiff.
Chance gets smaller as Diff gets bigger.
EXAMPLE:
if ( iValDiff == iValVarianceHalf ) return( 250 )
if ( iValDiff == 0 ) return( 500 );