Epok Engine

PSYQO SDK

psyqo::SoftMath::squareRoot

Function · 2 overloads

Function

Computes the square root of a fixed point number, given an approximative hint.

Belongs to
psyqo::SoftMath
Header
soft-math.hh
Overloads
2

Declaration 1 of 2

Declaration
FixedPoint<> squareRoot(FixedPoint<> x, FixedPoint<> y)

Computes the square root of a fixed point number, given an approximative hint.

ParameterTypeMeaning
xFixedPoint<>The number to compute the square root of.
yFixedPoint<>The approximative hint of the result.

Returns: FixedPoint<> — psyqo::FixedPoint<> The square root.

Example

C++ example
#include "psyqo/soft-math.hh"

// Assume these named values have been initialized with valid data:
// FixedPoint<> x
// FixedPoint<> y

auto result = psyqo::SoftMath::squareRoot(x, y);

Why use it

Fixed-point inputs keep console behavior deterministic and avoid software floating-point work.

Trade-offs and warnings

Stay within the documented range and account for quantization before chaining several operations.

Declared in https://github.com/pcsx-redux/nugget/blob/6186b131aacc5853a9161fb076ed34ffe504552d/psyqo/soft-math.hh:184

Declaration 2 of 2

static
Declaration
static inline FixedPoint<> squareRoot(FixedPoint<> x)

Computes the square root of a fixed point number.

ParameterTypeMeaning
xFixedPoint<>The number to compute the square root of.

Returns: FixedPoint<> — psyqo::FixedPoint<> The square root.

Example

C++ example
#include "psyqo/soft-math.hh"

// Assume these named values have been initialized with valid data:
// FixedPoint<> x

auto result = psyqo::SoftMath::squareRoot(x);

Why use it

Fixed-point inputs keep console behavior deterministic and avoid software floating-point work.

Trade-offs and warnings

Stay within the documented range and account for quantization before chaining several operations.

Declared in https://github.com/pcsx-redux/nugget/blob/6186b131aacc5853a9161fb076ed34ffe504552d/psyqo/soft-math.hh:192

Related members