pub trait Real:
Float
+ Add
+ AddAssign
+ Sub
+ SubAssign
+ Mul
+ MulAssign
+ Div
+ DivAssign
+ Copy
+ Clone
+ Pi
+ IntoDegrees
+ IntoRadians
+ PartialEq
+ PartialOrd
+ Debug
+ Display {
// Required methods
fn is_f32() -> bool;
fn is_f64() -> bool;
fn float_type() -> FloatType;
fn as_f32(self) -> f32;
fn as_f64(self) -> f64;
}
Expand description
This type represents a real number. A macro trait that makes using generic floats much easier
Required Methods§
Sourcefn is_f32() -> bool
fn is_f32() -> bool
Is this type a single-precision floating point. Useful for identifying the underlying representation for SIMD purposes
Sourcefn is_f64() -> bool
fn is_f64() -> bool
Is this type a double-precision floating point. Useful for identifying the underlying representation for SIMD purposes
Sourcefn float_type() -> FloatType
fn float_type() -> FloatType
Return the floating point type as an enum. Mostly just a convinience instead of using
is_f32()
or is_f64()
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.