Skip to main content

Float

Trait Float 

Source
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§

Source

const ZERO: Self

Source

const ONE: Self

Source

const TWO: Self

Source

const PI: Self

Source

const EPSILON_VAL: Self

Required Methods§

Source

fn from_f64(x: f64) -> Self

Source

fn to_f64(self) -> f64

Source

fn sqrt(self) -> Self

Source

fn cbrt(self) -> Self

Source

fn sin(self) -> Self

Source

fn cos(self) -> Self

Source

fn exp(self) -> Self

Source

fn ln(self) -> Self

Source

fn abs(self) -> Self

Source

fn powi(self, n: i32) -> Self

Source

fn powf(self, e: Self) -> Self

Source

fn max(self, other: Self) -> Self

Source

fn min(self, other: Self) -> Self

Source

fn is_finite(self) -> bool

Source

fn is_nan(self) -> bool

Provided Methods§

Source

fn recip(self) -> Self

Source

fn sin_cos(self) -> (Self, Self)

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.

Implementations on Foreign Types§

Source§

impl Float for f64

Source§

const ZERO: Self = 0.0

Source§

const ONE: Self = 1.0

Source§

const TWO: Self = 2.0

Source§

const PI: Self = std::f64::consts::PI

Source§

const EPSILON_VAL: Self = f64::EPSILON

Source§

fn from_f64(x: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn ln(self) -> Self

Source§

fn abs(self) -> Self

Source§

fn powi(self, n: i32) -> Self

Source§

fn powf(self, e: Self) -> Self

Source§

fn max(self, other: Self) -> Self

Source§

fn min(self, other: Self) -> Self

Source§

fn is_finite(self) -> bool

Source§

fn is_nan(self) -> bool

Source§

fn sin_cos(self) -> (Self, Self)

Implementors§