Skip to main content

Module math

Module math 

Source
Expand description

Deterministic elementary functions.

f64::sin and friends call the platform’s math library, whose results differ in the last bit between Windows, Linux, macOS and WebAssembly. Everything that feeds stored geometry, solver iterations, exported files or the scene goes through these wrappers (the pure-Rust libm), so the same input gives the same bits on every platform (DL-TEST-6). sqrt is correctly rounded everywhere and stays f64::sqrt.

Functions§

acos
Arccosine.
atan
Arctangent.
atan2
Four-quadrant arctangent of y / x.
cos
Cosine.
hypot
sqrt(x² + y²) without undue overflow.
log2
Base-2 logarithm.
sin
Sine.
sin_cos
(sin x, cos x).
tan
Tangent.