class
MathUtilsContents
- Reference
Special Math utilities
Public static functions
- static auto IsPowerOfTwo(const fsize nb) -> bool
- static auto FindNextPowerOfTwo(fsize nb) -> fsize
- static auto IsPrime(fisize nb) -> bool
- static auto FindNextPrime(fisize nb) -> fisize
- static auto InvSqrt(float nb) -> float
Function documentation
static bool bpf::math::MathUtils:: IsPowerOfTwo(const fsize nb)
Parameters | |
---|---|
nb | the number to check |
Returns | true if nb is a power of two, false otherwise |
Check if a number is a power of two
static fsize bpf::math::MathUtils:: FindNextPowerOfTwo(fsize nb)
Parameters | |
---|---|
nb | the number to find the next power of two |
Returns | next power of two > nb |
Finds the next power of two of a given number
static fisize bpf::math::MathUtils:: FindNextPrime(fisize nb)
Parameters | |
---|---|
nb | the number to find the next prime |
Returns | next prime number > nb |
Finds the next prime number of a given number
static float bpf::math::MathUtils:: InvSqrt(float nb)
Parameters | |
---|---|
nb | the number to find the inverse square root |
Returns | inverse square root of nb |
Computes the fast inverse square root of a number