Skip to main content

Module math

Module math 

Source
Expand description

Tested, const fn versions of libm float math functions. e.g. use deep_time::math::sin;

Re-exports of sin, cos, tan, atan, atan2, floor_f, rem_euclid_f, sqrt, log.

Functions§

atan
Computes the arctangent of x (atan(x)).
atan2
Computes the four-quadrant arctangent of y / x (atan2(y, x)).
cos
Computes the cosine of x in radians (cos(x)).
floor_f
Floor function for Real.
hypot
Computes sqrt(x² + y²) without overflow or harmful underflow.
log
The natural logarithm of x (Real).
powi
Raises a floating-point number to an integer power.
rem_euclid_f
const friendly rem euclid function for float.
round
Const-compatible version of f64::round (rounds to the nearest integer).
sin
Computes the sine of x (in radians).
sqrt
Computes sqrt(x) using the table-driven Goldschmidt iteration from musl libc. Correctly rounded to nearest-even for all Real inputs. const, no std, no alloc friendly.
tan
Computes the tangent of x in radians (tan(x)).
trunc
Const-compatible version of f64::trunc (rounds toward zero)