Integer Maths Operations.


Functions

unsigned long lsqrt (unsigned long x)
unsigned long long lsqrt64 (unsigned long long x)

Function Documentation

unsigned long lsqrt unsigned long    x
 

Compute the square root of a number.

This function computes the square root of x using integer operations exclusively. It returns the integer that corresponds to sqrt(x).

This function operates on unsigned numbers and as such it always succeeds.

Returns:
the square root of x.
See also:
sqrt, lsqrt64

unsigned long long lsqrt64 unsigned long long    x
 

Compute the square root of a number.

This function computes the square root of x using integer operations exclusively. It returns the integer that corresponds to sqrt(x). lsqrt64 deals with 64-bit integers while lsqrt only handles 32-bit integers.

This function operates on unsigned numbers and as such it always succeeds.

Returns:
the square root of x.
See also:
sqrt, lsqrt