irox_fixedmath

Trait FloatExt

source
pub trait FloatExt {
    type Type;

    // Required methods
    fn trunc(self) -> Self::Type;
    fn fract(self) -> Self::Type;
    fn abs(self) -> Self::Type;
    fn round(self) -> Self::Type;
    fn floor(self) -> Self::Type;
    fn ceil(self) -> Self::Type;
    fn signum(self) -> Self::Type;
    fn exp(self) -> Self::Type;
    fn ln(self) -> Self::Type;
    fn powi(self, val: i32) -> Self::Type;
    fn powf(self, val: Self::Type) -> Self::Type;
    fn sqrt(self) -> Self::Type;
}

Required Associated Types§

Required Methods§

source

fn trunc(self) -> Self::Type

source

fn fract(self) -> Self::Type

source

fn abs(self) -> Self::Type

source

fn round(self) -> Self::Type

source

fn floor(self) -> Self::Type

source

fn ceil(self) -> Self::Type

source

fn signum(self) -> Self::Type

source

fn exp(self) -> Self::Type

source

fn ln(self) -> Self::Type

source

fn powi(self, val: i32) -> Self::Type

source

fn powf(self, val: Self::Type) -> Self::Type

source

fn sqrt(self) -> Self::Type

Implementations on Foreign Types§

source§

impl FloatExt for f32

source§

fn exp(self) -> <f32 as FloatExt>::Type

Implementation of Exponential Function from NIST DTMF eq 4.2.19: <https://dlmf.nist.gov/4.2.E19>

source§

fn ln(self) -> <f32 as FloatExt>::Type

Implementation of Natural Logarithm using NIST DLMF eq 4.6.4: <https://dlmf.nist.gov/4.6.E4>

source§

fn powf(self, a: <f32 as FloatExt>::Type) -> <f32 as FloatExt>::Type

Implementation of general power function using NIST DLMF eq 4.2.26: <https://dlmf.nist.gov/4.2.E26>

source§

fn powi(self, val: i32) -> <f32 as FloatExt>::Type

Naive implementation of integer power fn. Will do something smarter later.

source§

type Type = f32

source§

fn trunc(self) -> f32

source§

fn fract(self) -> f32

source§

fn abs(self) -> f32

source§

fn round(self) -> f32

source§

fn floor(self) -> f32

source§

fn ceil(self) -> f32

source§

fn signum(self) -> f32

source§

fn sqrt(self) -> <f32 as FloatExt>::Type

source§

impl FloatExt for f64

source§

fn trunc(self) -> f64

Truncate the value Just casts to u64 then back to f64.

source§

fn abs(self) -> f64

Force the value to be positive by zeroing out the highest sign bit.

source§

fn exp(self) -> <f64 as FloatExt>::Type

Implementation of Exponential Function from NIST DTMF eq 4.2.19: <https://dlmf.nist.gov/4.2.E19>

source§

fn ln(self) -> <f64 as FloatExt>::Type

Implementation of Natural Logarithm using NIST DLMF eq 4.6.4: <https://dlmf.nist.gov/4.6.E4>

source§

fn powf(self, a: <f64 as FloatExt>::Type) -> <f64 as FloatExt>::Type

Implementation of general power function using NIST DLMF eq 4.2.26: <https://dlmf.nist.gov/4.2.E26>

source§

fn powi(self, val: i32) -> <f64 as FloatExt>::Type

Naive implementation of integer power fn. Will do something smarter later.

source§

type Type = f64

source§

fn fract(self) -> f64

source§

fn round(self) -> f64

source§

fn floor(self) -> f64

source§

fn ceil(self) -> f64

source§

fn signum(self) -> f64

source§

fn sqrt(self) -> <f64 as FloatExt>::Type

Implementors§