Skip to main content

Module math

Module math 

Source
Expand description

exp and ln for every pure path (spec 047).

The platform’s math library differs between targets (glibc, musl, Apple, Microsoft and Rust’s own on WebAssembly) in the last bit of some results, so the pure crates never call f64::exp or f64::ln. These functions are one pure Rust implementation, the libm crate exact-pinned without default features, and give the same bits on every target. They are not correctly rounded, so they stay outside exact computation (spec 002, 3.4.6); a test (tests/platform_math.rs) refuses a direct call.

Functions§

exp
e raised to x.
ln
The natural logarithm of x.