# _TB_Trunc
inline function _TB_Trunc(v)Truncates a numeric value toward zero for deterministic lookup-table generation.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
src/tables.mlProvides precomputed lookup tables used by fixed-point math and rendering.
m_fixed.ml → src/m_fixed.mlstd/math.ml → ../MiniLangCompilerOptimization/MiniLangCompilerPy/std/math.ml external dependencytables.ml → src/tables.mlinline function _TB_Trunc(v)Truncates a numeric value toward zero for deterministic lookup-table generation.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
const ANG180 = 2147483648Defines ang180 for the tables subsystem.
const ANG270 = 3221225472Defines ang270 for the tables subsystem.
const ANG45 = 536870912Defines ang45 for the tables subsystem.
const ANG90 = 1073741824Defines ang90 for the tables subsystem.
const ANGLETOFINESHIFT = 19Defines angletofineshift for the tables subsystem.
const DBITS = 5Defines dbits for the tables subsystem.
const FINEANGLES = 8192Defines fineangles for the tables subsystem.
finecosineHolds the optional finecosine resource used by the tables subsystem.
const FINEMASK = FINEANGLES - 1Defines finemask for the tables subsystem.
finesineHolds the optional finesine resource used by the tables subsystem.
finetangentHolds the optional finetangent resource used by the tables subsystem.
const PI = 3.141592657Defines pi for the tables subsystem.
const SLOPEBITS = 11Defines slopebits for the tables subsystem.
function SlopeDiv(num, den)Maps an unsigned rise/run ratio into Doom's bounded slope-table index without overflowing the numerator shift.
| Parameter | Type | Default | Description |
|---|---|---|---|
num | dynamic | — | Index identifying the requested item. |
den | dynamic | — | Den value supplied to `SlopeDiv`. |
const SLOPERANGE = 2048Defines sloperange for the tables subsystem.
function Tables_Init()Lazily generates the fixed-point sine, cosine, tangent, and slope-to-angle lookup tables at their canonical Doom sizes.
tantoangleHolds the optional tantoangle resource used by the tables subsystem.