pub trait FloatExt: PrimitiveMath {
type Type;
type Size;
Show 22 methods
// 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 clamp(self, min: Self, max: Self) -> Self::Type;
fn exp(self) -> Self::Type;
fn ln(self) -> Self::Type;
fn log10(self) -> Self::Type;
fn powi(self, val: i32) -> Self::Type;
fn powf(self, val: Self::Type) -> Self::Type;
fn sqrt(self) -> Self::Type;
fn to_bits(self) -> Self::Size;
fn exponent(self) -> u16;
fn significand(self) -> Self::Size;
fn sin(self) -> Self::Type;
fn cos(self) -> Self::Type;
fn tan(self) -> Self::Type;
fn atan(self) -> Self::Type;
fn atan2(self, o: Self) -> Self::Type;
}Required Associated Types§
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 clamp(self, min: Self, max: Self) -> Self::Type
fn exp(self) -> Self::Type
fn ln(self) -> Self::Type
fn log10(self) -> Self::Type
fn powi(self, val: i32) -> Self::Type
fn powf(self, val: Self::Type) -> Self::Type
fn sqrt(self) -> Self::Type
fn to_bits(self) -> Self::Size
fn exponent(self) -> u16
fn significand(self) -> Self::Size
fn sin(self) -> Self::Type
fn cos(self) -> Self::Type
fn tan(self) -> Self::Type
fn atan(self) -> Self::Type
fn atan2(self, o: Self) -> Self::Type
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 FloatExt for f32
impl FloatExt for f32
Source§fn exp(self) -> Self::Type
fn exp(self) -> Self::Type
Implementation of Exponential Function from NIST DTMF eq 4.2.19: <https://dlmf.nist.gov/4.2.E19>
Source§fn ln(self) -> Self::Type
fn ln(self) -> Self::Type
Implementation of Natural Logarithm using NIST DLMF eq 4.6.4: <https://dlmf.nist.gov/4.6.E4>
Source§fn powi(self, val: i32) -> Self::Type
fn powi(self, val: i32) -> Self::Type
Naive implementation of integer power fn. Will do something smarter later.
Source§fn powf(self, a: Self::Type) -> Self::Type
fn powf(self, a: Self::Type) -> Self::Type
Implementation of general power function using NIST DLMF eq 4.2.26: <https://dlmf.nist.gov/4.2.E26>
type Type = f32
type Size = u32
fn trunc(self) -> f32
fn fract(self) -> f32
fn abs(self) -> f32
fn round(self) -> f32
fn floor(self) -> f32
fn ceil(self) -> f32
fn signum(self) -> f32
fn clamp(self, min: Self, max: Self) -> Self::Type
fn log10(self) -> Self::Type
fn sqrt(self) -> Self::Type
fn to_bits(self) -> Self::Size
fn exponent(self) -> u16
fn significand(self) -> Self::Size
fn sin(self) -> Self::Type
fn cos(self) -> Self::Type
fn tan(self) -> Self::Type
fn atan(self) -> Self::Type
fn atan2(self, o: Self) -> Self::Type
Source§impl FloatExt for f64
Available on crate feature std only.
impl FloatExt for f64
Available on crate feature
std only.