math.exp
e to the power x from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
exp in Rust
1.0.1
py rs ts
10 tests
math.integer-sqrt
Exact integer square root: the largest whole number whose square does not exceed n.
integer_sqrt in Rust
1.0.0
py rs ts
11 tests
math.round-float
Round a float half away from zero to 0-12 decimal places, identically in TypeScript, Python and Rust.
round_float in Rust
1.0.0
py rs ts
22 tests
math.big-integer
Exact integer arithmetic of any size, on decimal strings, for powers and products that overflow 64 bits.
calculate_big_integer in Rust
1.0.0
py rs ts
24 tests
math.pow
base to the power exponent from + - * / only, exact by squaring for whole exponents, identical in every language.
pow in Rust
1.0.0
py rs ts
16 tests
math.sin-cos
Sine and cosine of an angle in radians from + - * / only, so every language returns the same doubles.
sin_cos in Rust
1.0.1
py rs ts
10 tests
math.basis-points
Convert a rate between percent, basis points and a plain ratio exactly, as decimal text or integer basis points.
A group of 3: convert_rate, to_basis_points, from_basis_points
2.0.0
py rs ts
45 tests
math.round-div
Integer division with an explicit rounding mode, for money arithmetic that must not drift.
round_div in Rust
1.0.0
py rs ts
14 tests
math.atan
Arctangent in radians from + - * / only (fdlibm's method), so every language returns the same double.
atan in Rust
1.0.1
py rs ts
22 tests
math.clamp
Clamp an integer to an inclusive range, refusing a range whose bounds are the wrong way round.
clamp in Rust
1.0.0
py rs ts
12 tests
math.fractional-power
Raise a positive decimal to a fractional power, (1.199)^(31/365), identically in every language.
fractional_power in Rust
1.0.0
py rs ts
19 tests
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
2.0.0
py rs ts
39 tests
math.ln
Natural logarithm from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
ln in Rust
1.0.1
py rs ts
11 tests
math.percent-change
Percentage change from one value to another, in basis points, with an explicit rounding mode.
percent_change in Rust
1.0.0
py rs ts
19 tests
math.rational
Exact fraction arithmetic, always reduced, for rates and ratios that must not drift.
A group of 8: calculate_rational, rational, add_rational, subtract_rational, multiply_rational, divide_rational, compare_rational, rational_to_integer
2.0.0
py rs ts
86 tests
math.round-div-big
Divide two integers of any size with an explicit rounding mode, on decimal strings, for exact money sums past 2^53.
round_div_big in Rust
1.0.0
py rs ts
21 tests