StdFloat

Trait StdFloat 

Source
pub unsafe trait StdFloat: StdFloat + Float {
Show 36 methods // Required methods fn div_euclid(self, rhs: Self) -> Self; fn rem_euclid(self, rhs: Self) -> Self; fn mul_add(self, a: Self, b: Self) -> Self; fn powf(self, exp: Self) -> Self; fn powi(self, exp: i32) -> Self; fn exp(self) -> Self; fn exp_m1(self) -> Self; fn exp2(self) -> Self; fn sqrt(self) -> Self; fn cbrt(self) -> Self; fn log(self, base: Self) -> Self; fn ln(self) -> Self; fn ln_1p(self) -> Self; fn log2(self) -> Self; fn log10(self) -> Self; fn hypot(self, rhs: Self) -> Self; fn sin(self) -> Self; fn cos(self) -> Self; fn tan(self) -> Self; fn sin_cos(self) -> (Self, Self); fn asin(self) -> Self; fn acos(self) -> Self; fn atan(self) -> Self; fn atan2(self, rhs: 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 round(self) -> Self; fn round_ties_even(self) -> Self; fn floor(self) -> Self; fn ceil(self) -> Self; fn trunc(self) -> Self; fn fract(self) -> Self;
}
Available on crate feature std only.
Expand description

Extends Float with std-only functionality.

Note that as core_float_math stabilises (see #137578), users of this trait should prepare for its deprecation.

§Safety

All items must behave exactly as their standard counterparts.

Required Methods§

Source

fn div_euclid(self, rhs: Self) -> Self

Source

fn rem_euclid(self, rhs: Self) -> Self

Source

fn mul_add(self, a: Self, b: Self) -> Self

See f64::mul_add.

Source

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

See f64::powf.

Source

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

See f64::powi.

Source

fn exp(self) -> Self

See f64::exp.

Source

fn exp_m1(self) -> Self

See f64::exp_m1.

Source

fn exp2(self) -> Self

See f64::exp2.

Source

fn sqrt(self) -> Self

See f64::sqrt.

Source

fn cbrt(self) -> Self

See f64::cbrt.

Source

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

See f64::log.

Source

fn ln(self) -> Self

See f64::ln.

Source

fn ln_1p(self) -> Self

See f64::ln_1p.

Source

fn log2(self) -> Self

See f64::log2.

Source

fn log10(self) -> Self

See f64::log10.

Source

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

See f64::hypot.

Source

fn sin(self) -> Self

See f64::sin.

Source

fn cos(self) -> Self

See f64::cos.

Source

fn tan(self) -> Self

See f64::tan.

Source

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

See f64::sin_cos.

Source

fn asin(self) -> Self

See f64::asin.

Source

fn acos(self) -> Self

See f64::acos.

Source

fn atan(self) -> Self

See f64::atan.

Source

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

See f64::atan2.

Source

fn sinh(self) -> Self

See f64::sinh.

Source

fn cosh(self) -> Self

See f64::cosh.

Source

fn tanh(self) -> Self

See f64::tanh.

Source

fn asinh(self) -> Self

See f64::asinh.

Source

fn acosh(self) -> Self

See f64::acosh.

Source

fn atanh(self) -> Self

See f64::atanh.

Source

fn round(self) -> Self

See f64::round.

Source

fn round_ties_even(self) -> Self

Source

fn floor(self) -> Self

See f64::floor.

Source

fn ceil(self) -> Self

See f64::ceil.

Source

fn trunc(self) -> Self

See f64::trunc.

Source

fn fract(self) -> Self

See f64::fract.

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 StdFloat for f16

Available on crate feature f16 only.
Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn mul_add(self, a: Self, b: Self) -> Self

Source§

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

Source§

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

Source§

fn exp(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

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

Source§

fn ln(self) -> Self

Source§

fn ln_1p(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log10(self) -> Self

Source§

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

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

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

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, rhs: 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 round(self) -> Self

Source§

fn round_ties_even(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Source§

impl StdFloat for f32

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn mul_add(self, a: Self, b: Self) -> Self

Source§

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

Source§

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

Source§

fn exp(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

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

Source§

fn ln(self) -> Self

Source§

fn ln_1p(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log10(self) -> Self

Source§

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

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

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

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, rhs: 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 round(self) -> Self

Source§

fn round_ties_even(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Source§

impl StdFloat for f64

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn mul_add(self, a: Self, b: Self) -> Self

Source§

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

Source§

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

Source§

fn exp(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

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

Source§

fn ln(self) -> Self

Source§

fn ln_1p(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log10(self) -> Self

Source§

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

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

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

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, rhs: 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 round(self) -> Self

Source§

fn round_ties_even(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Source§

impl StdFloat for f128

Available on crate feature f128 only.
Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn mul_add(self, a: Self, b: Self) -> Self

Source§

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

Source§

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

Source§

fn exp(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

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

Source§

fn ln(self) -> Self

Source§

fn ln_1p(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log10(self) -> Self

Source§

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

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

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

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, rhs: 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 round(self) -> Self

Source§

fn round_ties_even(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Implementors§