5 constexpr PL_ALWAYS_INLINE plInt32
RoundUp(plInt32 value, plUInt16 uiMultiple)
8 return (value >= 0) ? ((value + uiMultiple - 1) / uiMultiple) * uiMultiple : (value / uiMultiple) * uiMultiple;
11 constexpr PL_ALWAYS_INLINE plInt32
RoundDown(plInt32 value, plUInt16 uiMultiple)
14 return (value <= 0) ? ((value - uiMultiple + 1) / uiMultiple) * uiMultiple : (value / uiMultiple) * uiMultiple;
17 constexpr PL_ALWAYS_INLINE plUInt32
RoundUp(plUInt32 value, plUInt16 uiMultiple)
20 return ((value + uiMultiple - 1) / uiMultiple) * uiMultiple;
23 constexpr PL_ALWAYS_INLINE plUInt32
RoundDown(plUInt32 value, plUInt16 uiMultiple)
26 return (value / uiMultiple) * uiMultiple;
29 constexpr PL_ALWAYS_INLINE
bool IsOdd(plInt32 i)
32 return ((i & 1) != 0);
35 constexpr PL_ALWAYS_INLINE
bool IsEven(plInt32 i)
38 return ((i & 1) == 0);
41 PL_ALWAYS_INLINE plUInt32
Log2i(plUInt32 uiVal)
46 constexpr PL_ALWAYS_INLINE
int Pow2(
int i)
52 inline int Pow(
int iBase,
int iExp)
This namespace provides common math-functionality as functions.
Definition Constants.h:6
double RoundDown(double f, double fMultiple)
Returns a multiple of fMultiple that is smaller than f.
Definition MathDouble_inl.h:40
PL_ALWAYS_INLINE plUInt32 FirstBitHigh(plUInt32 value)
Returns the index of the most significant bit set.
Definition Math_inl.h:119
double RoundUp(double f, double fMultiple)
Returns a multiple of fMultiple that is larger than f.
Definition MathDouble_inl.h:47
constexpr PL_ALWAYS_INLINE bool IsOdd(plInt32 i)
Returns true, if i is an odd number.
Definition MathInt32_inl.h:29
constexpr PL_ALWAYS_INLINE bool IsEven(plInt32 i)
Returns true, if i is an even number.
Definition MathInt32_inl.h:35
PL_ALWAYS_INLINE plUInt32 Log2i(plUInt32 uiVal)
Returns the integral logarithm to the base 2, that comes closest to the given integer.
Definition MathInt32_inl.h:41