pub trait Float<T>: ArithmeticOps<T> {
// Required methods
fn abs(self) -> T;
fn floor(self) -> T;
fn ceil(self) -> T;
fn trunc(self) -> T;
fn round(self) -> T;
fn nearest(self) -> T;
fn sqrt(self) -> T;
fn is_sign_positive(self) -> bool;
fn is_sign_negative(self) -> bool;
fn min(self, other: T) -> T;
fn max(self, other: T) -> T;
fn copysign(self, other: T) -> T;
}Expand description
Float-point value.
Required Methods§
Sourcefn round(self) -> T
fn round(self) -> T
Returns the nearest integer to a number. Round half-way cases away from 0.0.
Sourcefn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Returns true if the sign of the number is positive.
Sourcefn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
Returns true if the sign of the number is negative.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.