pub trait Float:
Copy
+ Send
+ Sync
+ Debug
+ Display
+ PartialEq
+ PartialOrd
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ Neg<Output = Self>
+ AddAssign
+ SubAssign
+ MulAssign
+ DivAssign
+ 'static {
const ZERO: Self;
const ONE: Self;
const TWO: Self;
const PI: Self;
const EPSILON_VAL: Self;
Show 17 methods
// Required methods
fn from_f64(x: f64) -> Self;
fn to_f64(self) -> f64;
fn sqrt(self) -> Self;
fn cbrt(self) -> Self;
fn sin(self) -> Self;
fn cos(self) -> Self;
fn exp(self) -> Self;
fn ln(self) -> Self;
fn abs(self) -> Self;
fn powi(self, n: i32) -> Self;
fn powf(self, e: Self) -> Self;
fn max(self, other: Self) -> Self;
fn min(self, other: Self) -> Self;
fn is_finite(self) -> bool;
fn is_nan(self) -> bool;
// Provided methods
fn recip(self) -> Self { ... }
fn sin_cos(self) -> (Self, Self) { ... }
}Expand description
Multi-precision floating-point trait.
Implemented for f64 (Phase 1). DDReal, QDReal, MpfrFloat in Phase 2+. Every arithmetic operation, transcendental, and conversion needed by the solver and diagnostics pipeline.
Required Associated Constants§
const ZERO: Self
const ONE: Self
const TWO: Self
const PI: Self
const EPSILON_VAL: Self
Required Methods§
fn from_f64(x: f64) -> Self
fn to_f64(self) -> f64
fn sqrt(self) -> Self
fn cbrt(self) -> Self
fn sin(self) -> Self
fn cos(self) -> Self
fn exp(self) -> Self
fn ln(self) -> Self
fn abs(self) -> Self
fn powi(self, n: i32) -> Self
fn powf(self, e: Self) -> Self
fn max(self, other: Self) -> Self
fn min(self, other: Self) -> Self
fn is_finite(self) -> bool
fn is_nan(self) -> bool
Provided Methods§
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.