Tagged primitive
9 capabilities
math.exp
e to the power x from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
exp in Python
math.pow
base to the power exponent from + - * / only, exact by squaring for whole exponents, identical in every language.
pow in Python
math.round-div
Integer division with an explicit rounding mode, for money arithmetic that must not drift.
round_div in Python
math.clamp
Clamp an integer to an inclusive range, refusing a range whose bounds are the wrong way round.
clamp in Python
math.gcd-lcm
Greatest common divisor and least common multiple of two integers, exactly and without overflow.
A group of 3:
gcd_lcm, gcd, lcm
math.integer-sqrt
Exact integer square root: the largest whole number whose square does not exceed n.
integer_sqrt in Python
math.ln
Natural logarithm from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
ln in Python
math.round-float
Round a float half away from zero to 0-12 decimal places, identically in TypeScript, Python and Rust.
round_float in Python