# _absS32
inline function _absS32(x)Returns a signed 32-bit magnitude while saturating the unrepresentable INT32_MIN case.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
src/m_fixed.mlImplements Doom's signed 16.16 fixed-point multiply and divide with explicit 32-bit wrap, saturation, and zero handling.
doomtype.ml → src/doomtype.mli_system.ml → src/i_system.mlstd/math.ml → ../MiniLangCompilerOptimization/MiniLangCompilerPy/std/math.ml external dependencystdlib.ml → src/stdlib.mlinline function _absS32(x)Returns a signed 32-bit magnitude while saturating the unrepresentable INT32_MIN case.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
inline function _idivS32(a, b)Returns a signed integer quotient truncated toward zero, or zero for invalid operands and a zero divisor.
| Parameter | Type | Default | Description |
|---|---|---|---|
a | dynamic | — | First input operand. |
b | dynamic | — | Second input operand. |
function _s32(x)Reinterprets the low 32 bits of an integer as a signed two's-complement value.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
const _S32_MAX = 2147483647Defines the maximum s32 max accepted by the m fixed subsystem.
const _S32_MIN = -2147483648Defines the minimum s32 min accepted by the m fixed subsystem.
inline function _u32(x)Normalizes an integer to its unsigned 32-bit representation.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
function FixedDiv(a, b)Divides two signed 16.16 values, saturating results whose shifted numerator would overflow signed 32-bit range.
| Parameter | Type | Default | Description |
|---|---|---|---|
a | dynamic | — | First input operand. |
b | dynamic | — | Second input operand. |
inline function FixedDiv2(a, b)Scales a signed numerator by FRACUNIT, divides with truncation toward zero, and reports a zero divisor through I_Error.
| Parameter | Type | Default | Description |
|---|---|---|---|
a | dynamic | — | First input operand. |
b | dynamic | — | Second input operand. |
inline function FixedMul(a, b)Multiplies two 16.16 fixed-point operands with a 64-bit intermediate and returns a signed 32-bit fixed-point result.
| Parameter | Type | Default | Description |
|---|---|---|---|
a | dynamic | — | First input operand. |
b | dynamic | — | Second input operand. |
const FRACBITS = 16Defines fracbits for the m fixed subsystem.
const FRACUNIT = 1 << FRACBITSDefines fracunit for the m fixed subsystem.