Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Free functions

absReturns the absolute value of a fixed-point number….
addAdds two fixed-point numbers.
ceilRounds up to the nearest integer (toward positive infinity)….
divDivides two fixed-point numbers….
eqChecks equality of two fixed-point numbers.
expCalculates the natural exponential: e^x…
exp2Calculates the binary exponential: 2^x Supports both positive and negative exponents….
exp2_intFast 2^x for integer exponents. Uses a lookup table for O(1) computation….
floorRounds down to the nearest integer (toward negative infinity)….
ge—
gt—
le—
lnCalculates the natural logarithm: ln(x)…
log2Calculates the base-2 logarithm: log₂(x)…
log10Calculates the base-10 logarithm: log₁₀(x)…
lt—
mulMultiplies two fixed-point numbers.
mul_64—
ne—
neg—
powCalculates x^y (power function). Automatically uses a faster algorithm for integer exponents….
pow_int—
rem—
roundRounds to the nearest integer (half up)….
sqrtCalculates the square root….
cbrtCalculates the cube root. Preserves sign: cbrt(-8) = -2 Useful for 3-asset AMM pool calculations (geometric mean of 3 values)….
sub—
_split_unsigned—