SaturnRingLibrary 0.9
SGL wrapper
 
Loading...
Searching...
No Matches

◆ FastSqrt()

static constexpr uint32_t SRL::Math::Integer::FastSqrt ( uint32_t src)
inlinestaticconstexpr

Fast integer square root approximation with ~6% error.

Binary search approximation supporting full uint32_t range. Maximum 15 iterations after initial right shift by 2. Ideal for games where integer precision is sufficient and performance matters more than perfect accuracy.

Parameters
srcThe 32-bit integer value.
Returns
Approximate square root as whole number.