Epok Engine

PSYQO SDK

psyqo::operator/

Function template · 1 overload

Function template

Performs `operator /` as part of the fixed point module.

Belongs to
psyqo
Header
fixed-point.hh
Overloads
1

Declaration

template
Declaration
template <unsigned precisionBits = 12, std::integral T = int32_t, unsigned scale = 1 <<precisionBits, std::integral U = int32_t> constexpr FixedPoint<precisionBits, T, scale> operator/(U a, FixedPoint<precisionBits, T, scale> b)

Performs `operator /` as part of the fixed point module.

ParameterTypeMeaning
aUValue supplied for a. Keep referenced or pointed-to data valid for the complete call.
bFixedPoint<precisionBits, T, scale>Value supplied for b. Keep referenced or pointed-to data valid for the complete call.

Returns: FixedPoint<precisionBits, T, scale>. Check the value before continuing when it represents success, availability or a resource handle.

Example

C++ example
#include "psyqo/fixed-point.hh"

// Replace these template arguments with types or values accepted by the declaration:
// precisionBits, T, scale, U

// Assume these named values have been initialized with valid data:
// U a
// FixedPoint<precisionBits, T, scale> b

auto result = psyqo::operator/<precisionBits, T, scale, U>(a, b);

Why use it

Template dispatch is resolved at compile time and normally adds no runtime indirection. Fixed-point inputs keep console behavior deterministic and avoid software floating-point work.

Trade-offs and warnings

Every instantiated type must satisfy the header's compile-time requirements; extra instantiations can increase code size. Stay within the documented range and account for quantization before chaining several operations.

Declared in https://github.com/pcsx-redux/nugget/blob/6186b131aacc5853a9161fb076ed34ffe504552d/psyqo/fixed-point.hh:493

Related members