core::num::FloatingPoint
On this page
FloatingPointSource
pub trait FloatingPoint: Num + Neg<Output = Self>The binary floating-point types f32 and f64 (not the unbounded
float): their constants and math as one bound, T: FloatingPoint.
Each method is the type's own of the same name. Swift's name;
Rust's num::Float.
Not a number.
Positive infinity.
Negative infinity.
The gap between
1and the next larger value.Pi.
Euler's number e.
The absolute value.
The square root; NaN for a negative value.
The cube root.
e^self.The natural logarithm.
The base-2 logarithm.
The base-10 logarithm.
self^n.self^exp.The sine (radians).
The cosine (radians).
The tangent (radians).
The arcsine.
The arccosine.
The arctangent.
The angle of the point
(other, self).The hyperbolic sine.
The hyperbolic cosine.
The hyperbolic tangent.
sqrt(self^2 + other^2)without overflow on the way.Rounded down.
Rounded up.
Rounded to the nearest, half away from zero.
Rounded toward zero.
1/-1by the sign; NaN for NaN.self * a + bwith one rounding.The smaller of the two; a NaN loses to a number.
The larger of the two; a NaN loses to a number.
truefor NaN.truefor either infinity.truefor neither NaN nor an infinity.The IEEE 754 total order (
-NaN < -inf < .. < -0 < +0 < .. < inf < NaN).selfwidened or kept as anf64.xrounded toSelf(to nearest).nasSelf, rounded to nearest past 2^24 (f32) / 2^53 (f64).