Epok Engine

PSYQO SDK

psyqo::FixedPointInternals::iDiv

Function · 1 overload

Function

Performs `i div` as part of the fixed point module.

Belongs to
psyqo::FixedPointInternals
Header
fixed-point.hh
Overloads
1

Declaration

Declaration
constexpr uint32_t iDiv(uint64_t rem, uint32_t base, unsigned scale)

Performs `i div` as part of the fixed point module.

ParameterTypeMeaning
remuint64_tValue supplied for rem. Keep referenced or pointed-to data valid for the complete call.
baseuint32_tValue supplied for base. Keep referenced or pointed-to data valid for the complete call.
scaleunsigned intValue supplied for scale. Keep referenced or pointed-to data valid for the complete call.

Returns: uint32_t. Check the value before continuing when it represents success, availability or a resource handle.

Example

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

// Assume these named values have been initialized with valid data:
// uint64_t rem
// uint32_t base
// unsigned int scale

auto result = psyqo::FixedPointInternals::iDiv(rem, base, scale);

Why use it

It provides direct, allocation-conscious access to the fixed point module. No exception-based error path is implied by the signature.

Trade-offs and warnings

Call it only in the lifecycle phase described by the module. Validate indices, capacities and object state before use.

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

Related members