Epok Engine

EPOK RUNTIME

epok::floor_div

Function · 1 overload

Function

Floor division for a positive divisor, matching the GTE's arithmetic shift.

Belongs to
epok
Header
polygon.hpp
Overloads
1

Declaration

Declaration
inline int32_t floor_div(int64_t numerator, int32_t divisor)

Floor division for a positive divisor, matching the GTE's arithmetic shift.

ParameterTypeMeaning
numeratorint64_tValue supplied for numerator. Keep referenced or pointed-to data valid for the complete call.
divisorint32_tValue supplied for divisor. Keep referenced or pointed-to data valid for the complete call.

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

Example

C++ example
#include "polygon.hpp"

// Assume these named values have been initialized with valid data:
// int64_t numerator
// int32_t divisor

auto result = epok::floor_div(numerator, divisor);

Why use it

It provides direct, allocation-conscious access to PSX polygon preparation, clipping and submission. 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 runtime/polygon.hpp:71

Related members