module Scalars

This is the documentation for Enlighten.

module Scalars

Functions

Name

Description

Name

Description

Abs(s32)

Return the absolute value of a number.

Abs(s64)

Return the absolute value of a number.

Abs(float)

Return the absolute value of a number.

Abs(double)

Return the absolute value of a number.

Ceil(float)

Compute the next whole number greater than a.

Clamp(T &, const T &, const T &)

Clamp a numeric type T to the given range.

CountLeadingZeroBits(u32)

Returns the number of consecutive leading zero bits.

CountSetBits(u8)

Returns the number of set bits.

CountTrailingZeroBits(u32)

Returns the number of consecutive trailing zero bits.

DivideAndRoundUp(T, T)

Perform an integer division that rounds the result to the next integer.

EqualWithinEpsilon(float, float, float)

Returns true if Abs(a - b) is less than the epsilon.

FastFloatToInt(float)

Converts a float into a signed integer using a faster method than the standard C truncation convention which requires a rounding mode change.

Floor(float)

Compute the next whole number smaller than a.

IsMultiplePower2(u64, u64)

Returns true if u is multiple of the specified power of 2.

IsMultiplePower2(const void *, u64)

Returns true if p is multiple of the specified power of 2.

IsPower2(u64)

Return true is unsignedInt is a power of 2 or not.

Lerp(float, float, float)

Linearly interpolate between a and b with factor s.

Log(float, float)

Calculate the logarithm with specified base of the given number;.

Max(const T &, const T &)

Return the Max of a and b.

Max3(const T &, const T &, const T &)

Return the Max of {a,b,c}.

Min(const T &, const T &)

Return the Max of a and b.

Min3(const T &, const T &, const T &)

Return the Min of {a,b,c}.

Mod(float, float)

Return a modulo b.

RoundToNextMultiplePower2(u32, u32)

This will round the number u to the next multiple of a power of 2 if the number isn't already a multiple of the power of 2.

RoundToNextPower2(u32)

Round a 32bit unsigned int to the next power of 2.

RoundToNextPower2(u64)

Round a 64bit unsigned int to the next power of 2.

RoundToPrevMultiplePower2(u32, u32)

This will round the number u down to the previous multiple of a power of 2 if the number isn't already a multiple of the power of 2.



s32 Geo::Abs


public: s32 Abs
(
    s32 a
)


Return the absolute value of a number.



s64 Geo::Abs