Trait FloatExt

Source
pub trait FloatExt<T: Float>
where Self: Sized + Copy,
{
Show 57 methods // Required methods fn nan() -> Self; fn infinity() -> Self; fn neg_infinity() -> Self; fn neg_zero() -> Self; fn min_value() -> Self; fn min_positive_value() -> Self; fn max_value() -> Self; fn is_nan(self) -> bool; fn is_infinite(self) -> bool; fn is_finite(self) -> bool; fn is_normal(self) -> bool; fn classify(self) -> FpCategory; fn floor(self) -> Self; fn ceil(self) -> Self; fn round(self) -> Self; fn trunc(self) -> Self; fn fract(self) -> Self; fn abs(self) -> Self; fn signum(self) -> Self; fn is_sign_positive(self) -> bool; fn is_sign_negative(self) -> bool; fn mul_add(self, _: Self, _: Self) -> Self; fn recip(self) -> Self; fn powi(self, _: i32) -> Self; fn powf(self, _: Self) -> Self; fn sqrt(self) -> Self; fn exp(self) -> Self; fn exp2(self) -> Self; fn ln(self) -> Self; fn log(self, _: Self) -> Self; fn log2(self) -> Self; fn log10(self) -> Self; fn max(self, _: Self) -> Self; fn min(self, _: Self) -> Self; fn abs_sub(self, _: Self) -> Self; fn cbrt(self) -> Self; fn hypot(self, _: Self) -> Self; fn sin(self) -> Self; fn cos(self) -> Self; fn tan(self) -> Self; fn asin(self) -> Self; fn acos(self) -> Self; fn atan(self) -> Self; fn atan2(self, _: Self) -> Self; fn sin_cos(self) -> (Self, Self); fn exp_m1(self) -> Self; fn ln_1p(self) -> Self; fn sinh(self) -> Self; fn cosh(self) -> Self; fn tanh(self) -> Self; fn asinh(self) -> Self; fn acosh(self) -> Self; fn atanh(self) -> Self; fn integer_decode(self) -> (u64, i16, i8); fn epsilon() -> Self; fn to_degrees(self) -> Self; fn to_radians(self) -> Self;
}
Expand description

Similar to num_traits::Float, but without requiring NumCast and ToPrimitive.

Required Methods§

Source

fn nan() -> Self

Source

fn infinity() -> Self

Source

fn neg_infinity() -> Self

Source

fn neg_zero() -> Self

Source

fn min_value() -> Self

Source

fn min_positive_value() -> Self

Source

fn max_value() -> Self

Source

fn is_nan(self) -> bool

Source

fn is_infinite(self) -> bool

Source

fn is_finite(self) -> bool

Source

fn is_normal(self) -> bool

Source

fn classify(self) -> FpCategory

Source

fn floor(self) -> Self

Source

fn ceil(self) -> Self

Source

fn round(self) -> Self

Source

fn trunc(self) -> Self

Source

fn fract(self) -> Self

Source

fn abs(self) -> Self

Source

fn signum(self) -> Self

Source

fn is_sign_positive(self) -> bool

Source

fn is_sign_negative(self) -> bool

Source

fn mul_add(self, _: Self, _: Self) -> Self

Source

fn recip(self) -> Self

Source

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

Source

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

Source

fn sqrt(self) -> Self

Source

fn exp(self) -> Self

Source

fn exp2(self) -> Self

Source

fn ln(self) -> Self

Source

fn log(self, _: Self) -> Self

Source

fn log2(self) -> Self

Source

fn log10(self) -> Self

Source

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

Source

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

Source

fn abs_sub(self, _: Self) -> Self

Source

fn cbrt(self) -> Self

Source

fn hypot(self, _: Self) -> Self

Source

fn sin(self) -> Self

Source

fn cos(self) -> Self

Source

fn tan(self) -> Self

Source

fn asin(self) -> Self

Source

fn acos(self) -> Self

Source

fn atan(self) -> Self

Source

fn atan2(self, _: Self) -> Self

Source

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

Source

fn exp_m1(self) -> Self

Source

fn ln_1p(self) -> Self

Source

fn sinh(self) -> Self

Source

fn cosh(self) -> Self

Source

fn tanh(self) -> Self

Source

fn asinh(self) -> Self

Source

fn acosh(self) -> Self

Source

fn atanh(self) -> Self

Source

fn integer_decode(self) -> (u64, i16, i8)

Source

fn epsilon() -> Self

Source

fn to_degrees(self) -> Self

Source

fn to_radians(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.

Implementors§

Source§

impl<T: Float> FloatExt<T> for OrderedFloat<T>
where Self: Sized + Copy,