Epok Engine

EPOK RUNTIME

epok::fixed_math::q_sqrt

Function · 1 overload

Function

Square root of a Q12 value, in Q12.

Belongs to
epok::fixed_math
Header
fixed_math.hpp
Overloads
1

Declaration

Declaration
inline int32_t q_sqrt(int32_t raw)

Square root of a Q12 value, in Q12.

ParameterTypeMeaning
rawint32_tValue supplied for raw. 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 "fixed_math.hpp"

// Assume these named values have been initialized with valid data:
// int32_t raw

auto result = epok::fixed_math::q_sqrt(raw);

Why use it

It provides direct, allocation-conscious access to shared Q12 integer math primitives. 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/fixed_math.hpp:14

Related members