Detailed Description
The PMath class is a toolbox to do some standard numeric operations (clamp, NaN handling, linear interpolation, random numbers...)
You cannot create instances of PMath.
It can be used to clamp numbers, compute linear interpolation, compare floating point values or test for NaN.
#include <PMath.h>
Member Function Documentation
◆ AreAlmostEqual() [1/2]
|
inlinestatic |
◆ AreAlmostEqual() [2/2]
|
inlinestatic |
◆ AreAlmostEqualULP()
|
static |
Returns true if and only if the two specified values are equal according to the specified relative error.
◆ Clamp() [1/3]
|
inlinestatic |
◆ Clamp() [2/3]
|
inlinestatic |
◆ Clamp() [3/3]
|
inlinestatic |
◆ GCD()
|
inlinestatic |
◆ IntMax()
|
static |
Returns the maximum value for an int32.
◆ IntMin()
|
static |
Returns the minimum value for an int32.
◆ IsNaN() [1/2]
|
inlinestatic |
◆ IsNaN() [2/2]
|
inlinestatic |
◆ IsNthBitSet()
|
inlinestatic |
◆ IsPow2()
|
inlinestatic |
◆ LERP() [1/2]
|
inlinestatic |
◆ LERP() [2/2]
|
inlinestatic |
◆ NaNd()
|
inlinestatic |
◆ NaNf()
|
inlinestatic |
◆ Pow2Down()
|
static |
Returns the greatest power of two equal to or smaller than the argument.
Returns 0 if n is 0.
◆ Pow2Nearest()
|
static |
Returns the nearest power of two for the argument.
◆ Pow2Up()
|
static |
Returns the smallest power of two equal to or larger than the argument.
◆ RandBool()
|
static |
Returns a random boolean value.
This function can be used safely by multiple threads at the same time, i.e. several different threads will get different random values.
◆ RandUInt32()
|
static |
Returns a 32-bit unsigned int random value.
This function can be used safely by multiple threads at the same time, i.e. several different threads will get different random values.
◆ RandUInt63()
|
static |
Returns a 63-bit unsigned int random value (converted to Int64, it will always be a positive value).
This function can be used safely by multiple threads at the same time, i.e. several different threads will get different random values.
◆ RandUInt64()
|
static |
Returns a 64-bit unsigned int random value.
This function can be used safely by multiple threads at the same time, i.e. several different threads will get different random values.
◆ SetNthBit()
|
inlinestatic |
◆ Sigmoid()
|
inlinestatic |