Skip to main content

Fp

Trait Fp 

Source
pub trait Fp:
    Copy
    + PartialOrd
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Neg<Output = Self>
    + AddAssign
    + MulAssign
    + Send
    + Sync
    + 'static {
    const ZERO: Self;
    const ONE: Self;

    // Required methods
    fn exp(self) -> Self;
    fn sqrt(self) -> Self;
    fn maxf(self, o: Self) -> Self;
    fn fromf(x: f64) -> Self;
    fn f64(self) -> f64;
}
Expand description

Minimal float abstraction: just enough for the fixed graph. Not a general numeric tower — two impls (f32/f64), no external crates.

Required Associated Constants§

Source

const ZERO: Self

Source

const ONE: Self

Required Methods§

Source

fn exp(self) -> Self

Source

fn sqrt(self) -> Self

Source

fn maxf(self, o: Self) -> Self

Source

fn fromf(x: f64) -> Self

Source

fn f64(self) -> f64

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Fp for f32

Source§

const ZERO: Self = 0.0

Source§

const ONE: Self = 1.0

Source§

fn exp(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn maxf(self, o: Self) -> Self

Source§

fn fromf(x: f64) -> Self

Source§

fn f64(self) -> f64

Source§

impl Fp for f64

Source§

const ZERO: Self = 0.0

Source§

const ONE: Self = 1.0

Source§

fn exp(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn maxf(self, o: Self) -> Self

Source§

fn fromf(x: f64) -> Self

Source§

fn f64(self) -> f64

Implementors§