Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Functions

NameDescription
Abs(float)

Return the absolute value of a number.

Abs(double)

Return the absolute value of a number.

Abs(s64)

Return the absolute value of a number.

Abs(s32)

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.

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(u64)

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

RoundToNextPower2(u32)

Round a 32bit 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.


Anchor
ae621a619f1b3f046e76b82df3622fce2
ae621a619f1b3f046e76b82df3622fce2

float Geo::Abs

...

public: float Abs
(
    float a
)

...

Return the absolute value of a number.


Anchor
a33febcd65d6aeaade58aad9a9caf84c3
a33febcd65d6aeaade58aad9a9caf84c3

double Geo::Abs

...

public: double Abs
(
    double a
)

...

Return the absolute value of a number.


Anchor
a0a0a9c50bac75b4e9ad1d6bed8c39de2
a0a0a9c50bac75b4e9ad1d6bed8c39de2

s64 Geo::Abs

...

public: s64 Abs
(
    s64 a
)

...

Return the absolute value of a number.


Anchor
a9605c7e81133edd8a8b76161d61baeef
a9605c7e81133edd8a8b76161d61baeef

s32 Geo::Abs

...

public: s32 Abs
(
    s32 a
)

...

Return the absolute value of a number.


Anchor
a43b07ae1f1840a6e0f608010498cd063
a43b07ae1f1840a6e0f608010498cd063

float Geo::Ceil

...

public: float Ceil
(
    float a
)

...

Compute the next whole number greater than a.


Anchor
a5316478c15a3e02f04640b21b860827c
a5316478c15a3e02f04640b21b860827c

void Geo::Clamp

...

public: void Clamp
(
    T & toClamp,
    const T & lowerLimit,
    const T & upperLimit
)

...

Clamp a numeric type T to the given range.


Anchor
aa739215832419d597ef366a758efa399
aa739215832419d597ef366a758efa399

u32 Geo::CountTrailingZeroBits

...

public: u32 CountTrailingZeroBits
(
    u32 v
)

...

Returns the number of consecutive trailing zero bits.


Anchor
a38676a0247f5b39df84051d37523503e
a38676a0247f5b39df84051d37523503e

T Geo::DivideAndRoundUp

...

public: T DivideAndRoundUp
(
    T dividend,
    T divisor
)

...

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


Anchor
a7785a20c6a94ba85b54dcec707eeeb09
a7785a20c6a94ba85b54dcec707eeeb09

bool Geo::EqualWithinEpsilon

...

public: bool EqualWithinEpsilon
(
    float a,
    float b,
    float epsilon
)

...

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


Anchor
a5bd0455e00b52faf77ce8836f68b547d
a5bd0455e00b52faf77ce8836f68b547d

s32 Geo::FastFloatToInt

...

public: s32 FastFloatToInt
(
    float a
)

...

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


Anchor
a69b32c03883416414688cc81a190ab50
a69b32c03883416414688cc81a190ab50

float Geo::Floor

...

public: float Floor
(
    float a
)

...

Compute the next whole number smaller than a.


Anchor
a5b7bbe877c7403d45d5a960fcd146faa
a5b7bbe877c7403d45d5a960fcd146faa

bool Geo::IsMultiplePower2

...

public: bool IsMultiplePower2
(
    u64 u,
    u64 power2
)

...

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

NOTE - this function will incorrectly report 0 as a power of two. If this is important you will need to handle that case separately i.e. IsMultiplePower2(myInt) && myInt


Anchor
ae5a1f9cc5ddc06ab30d98d30e6d21487
ae5a1f9cc5ddc06ab30d98d30e6d21487

bool Geo::IsMultiplePower2

...

public: bool IsMultiplePower2
(
    const void * p,
    u64 power2
)

...

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

NOTE - this function will incorrectly report 0 as a power of two. If this is important you will need to handle that case separately i.e. IsMultiplePower2(myPtr) && myPtr


Anchor
af62548395bd7841eb4ccb4d03f807f61
af62548395bd7841eb4ccb4d03f807f61

bool Geo::IsPower2

...

public: bool IsPower2
(
    u64 unsignedInt
)

...

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

NOTE - this function will incorrectly report 0 as a power of two. If this is important you will need to handle that case separately i.e. IsPower2(myInt) && myInt


Anchor
a5d7a9dd69428b5608c6e6ca66de6f2ed
a5d7a9dd69428b5608c6e6ca66de6f2ed

float Geo::Lerp

...

public: float Lerp
(
    float a,
    float b,
    float s
)

...

Linearly interpolate between a and b with factor s.


Anchor
a83a04c1cac58c6b0f55801e79e7ff752
a83a04c1cac58c6b0f55801e79e7ff752

float Geo::Log

...

public: float Log
(
    float number,
    float base
)

...

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


Anchor
a7ac78cc812ac4ca663490f3a48bfd4c3
a7ac78cc812ac4ca663490f3a48bfd4c3

T Geo::Max

...

public: T Max
(
    const T & a,
    const T & b
)

...

Return the Max of a and b.


Anchor
a47f4dd6bef13eb3ecf9edf1bca9d6146
a47f4dd6bef13eb3ecf9edf1bca9d6146

T Geo::Max3

...

public: T Max3
(
    const T & a,
    const T & b,
    const T & c
)

...

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


Anchor
ad4a13ca946e184c626b0a20058a568ef
ad4a13ca946e184c626b0a20058a568ef

T Geo::Min

...

public: T Min
(
    const T & a,
    const T & b
)

...

Return the Max of a and b.


Anchor
aa8a08476e01835a9bd3088d6e1cae499
aa8a08476e01835a9bd3088d6e1cae499

T Geo::Min3

...

public: T Min3
(
    const T & a,
    const T & b,
    const T & c
)

...

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


Anchor
a029f4765d653b8586a0c79f7f309bd1d
a029f4765d653b8586a0c79f7f309bd1d

float Geo::Mod

...

public: float Mod
(
    float a,
    float b
)

...

Return a modulo b.


Anchor
a2045499c5745d02fb1225f148c91c034
a2045499c5745d02fb1225f148c91c034

u32 Geo::RoundToNextMultiplePower2

...

public: u32 RoundToNextMultiplePower2
(
    u32 u,
    u32 power2
)

...

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.

power2 must be a power2. This is asserted on but not verified.


Anchor
a5e6e339f1f373eacecf8d6d31b5ba9ba
a5e6e339f1f373eacecf8d6d31b5ba9ba

u64 Geo::RoundToNextPower2

...

public: u64 RoundToNextPower2
(
    u64 u
)

...

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

NOTE - This function will round 0 to 0, which isn't a power of 2. If this is important you will need to handle that case separately.


Anchor
a6b5cfbb145df7138e1a180d8ddebc591
a6b5cfbb145df7138e1a180d8ddebc591

u32 Geo::RoundToNextPower2

...

public: u32 RoundToNextPower2
(
    u32 u
)

...

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

NOTE - This function will round 0 to 0, which isn't a power of 2. If this is important you will need to handle that case separately.


Anchor
a642a55f18e19dff76522ba5d074bc59a
a642a55f18e19dff76522ba5d074bc59a

u32 Geo::RoundToPrevMultiplePower2

...

public: u32 RoundToPrevMultiplePower2
(
    u32 u,
    u32 power2
)

...

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.

power2 must be a power2. This is asserted on but not verified.