Skip to main content

Module float

Module float 

Source
Expand description

f64 math dispatched per build mode: inherent methods under std, libm under no_std. Free-function form (sqrt(x) not x.sqrt()) so call sites don’t need cfg-gated trait imports.

Functions§

abs
Absolute value.
acos
Arccosine.
acosh
Inverse hyperbolic cosine.
asin
Arcsine.
asinh
Inverse hyperbolic sine.
atan
Arctangent.
atan2
Four-quadrant arctangent of y/x.
atanh
Inverse hyperbolic tangent.
cbrt
Cube root.
cos
Cosine.
cosh
Hyperbolic cosine.
floor
Largest integer <= x.
fract
Returns the fractional part (x - trunc(x)).
ln
Natural logarithm.
log10
Base-10 logarithm.
mul_add
Fused multiply-add: a * b + c with a single rounding.
powf
Raises x to a floating-point power.
powi
Raises x to an integer power.
round
Rounds to the nearest integer, ties away from zero.
signum
Sign function: 1.0, -1.0, or NaN.
sin
Sine.
sin_cos
Sine and cosine in a single call.
sinh
Hyperbolic sine.
sqrt
Square root.
tan
Tangent.
tanh
Hyperbolic tangent.
to_degrees
Converts radians to degrees.
to_radians
Converts degrees to radians.
trunc
Truncates toward zero.