pub trait Float:
Copy
+ Default
+ PartialEq
+ PartialOrd
+ Debug
+ Display
+ LowerExp
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ Rem<Output = Self>
+ Neg<Output = Self>
+ AddAssign
+ SubAssign
+ MulAssign
+ DivAssign
+ Sum
+ Product
+ Send
+ Sync
+ 'static
+ Sealed {
const ZERO: Self;
const ONE: Self;
const TWO: Self;
const HALF: Self;
const PI: Self;
const INFINITY: Self;
const NAN: Self;
const EPSILON: Self;
const MIN_POSITIVE: Self;
const MAX: Self;
const MANTISSA_DIGITS: u32;
Show 19 methods
// Required methods
fn from_f64(x: f64) -> Self;
fn to_f64(self) -> f64;
fn abs(self) -> Self;
fn sqrt(self) -> Self;
fn hypot(self, other: Self) -> Self;
fn atan2(self, other: Self) -> Self;
fn sin_cos(self) -> (Self, Self);
fn exp(self) -> Self;
fn ln(self) -> Self;
fn ln_1p(self) -> Self;
fn powi(self, n: i32) -> Self;
fn mul_add(self, a: Self, b: Self) -> Self;
fn copysign(self, sign: Self) -> Self;
fn max(self, other: Self) -> Self;
fn min(self, other: Self) -> Self;
fn is_finite(self) -> bool;
fn is_infinite(self) -> bool;
fn is_nan(self) -> bool;
fn is_sign_negative(self) -> bool;
}Expand description
f32 or f64: the type of the parts of a Complex, and of the real numbers
a matrix of either gives, such as its norms and singular values. The methods are those of the
two types, for code generic over both. The trait is sealed.
Required Associated Constants§
Sourceconst MIN_POSITIVE: Self
const MIN_POSITIVE: Self
The smallest positive normal float.
Sourceconst MANTISSA_DIGITS: u32
const MANTISSA_DIGITS: u32
The number of significant bits, the hidden one included.
Required Methods§
Sourcefn hypot(self, other: Self) -> Self
fn hypot(self, other: Self) -> Self
√(self² + other²) without an overflow or underflow in the squares.
Sourcefn is_infinite(self) -> bool
fn is_infinite(self) -> bool
Whether it is infinite.
Sourcefn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
Whether its sign bit is set, as for -0.0.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".