Trait FloatMath

Source
pub trait FloatMath: SealedMath + Sized {
Show 54 methods // Required methods fn abs(x: Self) -> Self; fn copysign(x: Self, y: Self) -> Self; fn round(x: Self) -> Self; fn trunc(x: Self) -> Self; fn ceil(x: Self) -> Self; fn floor(x: Self) -> Self; fn scalbn(x: Self, y: i32) -> Self; fn frexp(x: Self) -> (Self, i32); fn hypot(x: Self, y: Self) -> Self; fn sqrt(x: Self) -> Self; fn cbrt(x: Self) -> Self; fn exp(x: Self) -> Self; fn exp_m1(x: Self) -> Self; fn exp2(x: Self) -> Self; fn exp10(x: Self) -> Self; fn log(x: Self) -> Self; fn log_1p(x: Self) -> Self; fn log2(x: Self) -> Self; fn log10(x: Self) -> Self; fn pow(x: Self, y: Self) -> Self; fn powi(x: Self, y: i32) -> Self; fn sin(x: Self) -> Self; fn cos(x: Self) -> Self; fn sin_cos(x: Self) -> (Self, Self); fn tan(x: Self) -> Self; fn sind(x: Self) -> Self; fn cosd(x: Self) -> Self; fn sind_cosd(x: Self) -> (Self, Self); fn tand(x: Self) -> Self; fn sinpi(x: Self) -> Self; fn cospi(x: Self) -> Self; fn sinpi_cospi(x: Self) -> (Self, Self); fn tanpi(x: Self) -> Self; fn asin(x: Self) -> Self; fn acos(x: Self) -> Self; fn atan(x: Self) -> Self; fn atan2(y: Self, x: Self) -> Self; fn asind(x: Self) -> Self; fn acosd(x: Self) -> Self; fn atand(x: Self) -> Self; fn atan2d(y: Self, x: Self) -> Self; fn asinpi(x: Self) -> Self; fn acospi(x: Self) -> Self; fn atanpi(x: Self) -> Self; fn atan2pi(y: Self, x: Self) -> Self; fn sinh(x: Self) -> Self; fn cosh(x: Self) -> Self; fn sinh_cosh(x: Self) -> (Self, Self); fn tanh(x: Self) -> Self; fn asinh(x: Self) -> Self; fn acosh(x: Self) -> Self; fn atanh(x: Self) -> Self; fn tgamma(x: Self) -> Self; fn lgamma(x: Self) -> (Self, i8);
}
Expand description

Floating point types with math functions.

Required Methods§

Source

fn abs(x: Self) -> Self

See the abs function.

Source

fn copysign(x: Self, y: Self) -> Self

See the copysign function.

Source

fn round(x: Self) -> Self

See the round function.

Source

fn trunc(x: Self) -> Self

See the trunc function.

Source

fn ceil(x: Self) -> Self

See the ceil function.

Source

fn floor(x: Self) -> Self

See the floor function.

Source

fn scalbn(x: Self, y: i32) -> Self

See the scalbn function.

Source

fn frexp(x: Self) -> (Self, i32)

See the frexp function.

Source

fn hypot(x: Self, y: Self) -> Self

See the hypot function.

Source

fn sqrt(x: Self) -> Self

See the sqrt function.

Source

fn cbrt(x: Self) -> Self

See the cbrt function.

Source

fn exp(x: Self) -> Self

See the exp function.

Source

fn exp_m1(x: Self) -> Self

See the exp_m1 function.

Source

fn exp2(x: Self) -> Self

See the exp2 function.

Source

fn exp10(x: Self) -> Self

See the exp10 function.

Source

fn log(x: Self) -> Self

See the log function.

Source

fn log_1p(x: Self) -> Self

See the log_1p function.

Source

fn log2(x: Self) -> Self

See the log2 function.

Source

fn log10(x: Self) -> Self

See the log10 function.

Source

fn pow(x: Self, y: Self) -> Self

See the pow function.

Source

fn powi(x: Self, y: i32) -> Self

See the powi function.

Source

fn sin(x: Self) -> Self

See the sin function.

Source

fn cos(x: Self) -> Self

See the cos function.

Source

fn sin_cos(x: Self) -> (Self, Self)

See the sin_cos function.

Source

fn tan(x: Self) -> Self

See the tan function.

Source

fn sind(x: Self) -> Self

See the sind function.

Source

fn cosd(x: Self) -> Self

See the cosd function.

Source

fn sind_cosd(x: Self) -> (Self, Self)

See the sind_cosd function.

Source

fn tand(x: Self) -> Self

See the tand function.

Source

fn sinpi(x: Self) -> Self

See the sinpi function.

Source

fn cospi(x: Self) -> Self

See the cospi function.

Source

fn sinpi_cospi(x: Self) -> (Self, Self)

See the sinpi_cospi function.

Source

fn tanpi(x: Self) -> Self

See the tanpi function.

Source

fn asin(x: Self) -> Self

See the asin function.

Source

fn acos(x: Self) -> Self

See the acos function.

Source

fn atan(x: Self) -> Self

See the atan function.

Source

fn atan2(y: Self, x: Self) -> Self

See the atan2 function.

Source

fn asind(x: Self) -> Self

See the asind function.

Source

fn acosd(x: Self) -> Self

See the acosd function.

Source

fn atand(x: Self) -> Self

See the atand function.

Source

fn atan2d(y: Self, x: Self) -> Self

See the atan2d function.

Source

fn asinpi(x: Self) -> Self

See the asinpi function.

Source

fn acospi(x: Self) -> Self

See the acospi function.

Source

fn atanpi(x: Self) -> Self

See the atanpi function.

Source

fn atan2pi(y: Self, x: Self) -> Self

See the atan2pi function.

Source

fn sinh(x: Self) -> Self

See the sinh function.

Source

fn cosh(x: Self) -> Self

See the cosh function.

Source

fn sinh_cosh(x: Self) -> (Self, Self)

See the sinh_cosh function.

Source

fn tanh(x: Self) -> Self

See the tanh function.

Source

fn asinh(x: Self) -> Self

See the asinh function.

Source

fn acosh(x: Self) -> Self

See the acosh function.

Source

fn atanh(x: Self) -> Self

See the atanh function.

Source

fn tgamma(x: Self) -> Self

See the tgamma function.

Source

fn lgamma(x: Self) -> (Self, i8)

See the lgamma function.

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 FloatMath for f32

Source§

fn abs(x: Self) -> Self

Source§

fn copysign(x: Self, y: Self) -> Self

Source§

fn round(x: Self) -> Self

Source§

fn trunc(x: Self) -> Self

Source§

fn ceil(x: Self) -> Self

Source§

fn floor(x: Self) -> Self

Source§

fn scalbn(x: Self, y: i32) -> Self

Source§

fn frexp(x: Self) -> (Self, i32)

Source§

fn hypot(x: Self, y: Self) -> Self

Source§

fn sqrt(x: Self) -> Self

Source§

fn cbrt(x: Self) -> Self

Source§

fn exp(x: Self) -> Self

Source§

fn exp_m1(x: Self) -> Self

Source§

fn exp2(x: Self) -> Self

Source§

fn exp10(x: Self) -> Self

Source§

fn log(x: Self) -> Self

Source§

fn log_1p(x: Self) -> Self

Source§

fn log2(x: Self) -> Self

Source§

fn log10(x: Self) -> Self

Source§

fn pow(x: Self, y: Self) -> Self

Source§

fn powi(x: Self, y: i32) -> Self

Source§

fn sin(x: Self) -> Self

Source§

fn cos(x: Self) -> Self

Source§

fn sin_cos(x: Self) -> (Self, Self)

Source§

fn tan(x: Self) -> Self

Source§

fn sind(x: Self) -> Self

Source§

fn cosd(x: Self) -> Self

Source§

fn sind_cosd(x: Self) -> (Self, Self)

Source§

fn tand(x: Self) -> Self

Source§

fn sinpi(x: Self) -> Self

Source§

fn cospi(x: Self) -> Self

Source§

fn sinpi_cospi(x: Self) -> (Self, Self)

Source§

fn tanpi(x: Self) -> Self

Source§

fn asin(x: Self) -> Self

Source§

fn acos(x: Self) -> Self

Source§

fn atan(x: Self) -> Self

Source§

fn atan2(y: Self, x: Self) -> Self

Source§

fn asind(x: Self) -> Self

Source§

fn acosd(x: Self) -> Self

Source§

fn atand(x: Self) -> Self

Source§

fn atan2d(y: Self, x: Self) -> Self

Source§

fn asinpi(x: Self) -> Self

Source§

fn acospi(x: Self) -> Self

Source§

fn atanpi(x: Self) -> Self

Source§

fn atan2pi(y: Self, x: Self) -> Self

Source§

fn sinh(x: Self) -> Self

Source§

fn cosh(x: Self) -> Self

Source§

fn sinh_cosh(x: Self) -> (Self, Self)

Source§

fn tanh(x: Self) -> Self

Source§

fn asinh(x: Self) -> Self

Source§

fn acosh(x: Self) -> Self

Source§

fn atanh(x: Self) -> Self

Source§

fn tgamma(x: Self) -> Self

Source§

fn lgamma(x: Self) -> (Self, i8)

Source§

impl FloatMath for f64

Source§

fn abs(x: Self) -> Self

Source§

fn copysign(x: Self, y: Self) -> Self

Source§

fn round(x: Self) -> Self

Source§

fn trunc(x: Self) -> Self

Source§

fn ceil(x: Self) -> Self

Source§

fn floor(x: Self) -> Self

Source§

fn scalbn(x: Self, y: i32) -> Self

Source§

fn frexp(x: Self) -> (Self, i32)

Source§

fn hypot(x: Self, y: Self) -> Self

Source§

fn sqrt(x: Self) -> Self

Source§

fn cbrt(x: Self) -> Self

Source§

fn exp(x: Self) -> Self

Source§

fn exp_m1(x: Self) -> Self

Source§

fn exp2(x: Self) -> Self

Source§

fn exp10(x: Self) -> Self

Source§

fn log(x: Self) -> Self

Source§

fn log_1p(x: Self) -> Self

Source§

fn log2(x: Self) -> Self

Source§

fn log10(x: Self) -> Self

Source§

fn pow(x: Self, y: Self) -> Self

Source§

fn powi(x: Self, y: i32) -> Self

Source§

fn sin(x: Self) -> Self

Source§

fn cos(x: Self) -> Self

Source§

fn sin_cos(x: Self) -> (Self, Self)

Source§

fn tan(x: Self) -> Self

Source§

fn sind(x: Self) -> Self

Source§

fn cosd(x: Self) -> Self

Source§

fn sind_cosd(x: Self) -> (Self, Self)

Source§

fn tand(x: Self) -> Self

Source§

fn sinpi(x: Self) -> Self

Source§

fn cospi(x: Self) -> Self

Source§

fn sinpi_cospi(x: Self) -> (Self, Self)

Source§

fn tanpi(x: Self) -> Self

Source§

fn asin(x: Self) -> Self

Source§

fn acos(x: Self) -> Self

Source§

fn atan(x: Self) -> Self

Source§

fn atan2(y: Self, x: Self) -> Self

Source§

fn asind(x: Self) -> Self

Source§

fn acosd(x: Self) -> Self

Source§

fn atand(x: Self) -> Self

Source§

fn atan2d(y: Self, x: Self) -> Self

Source§

fn asinpi(x: Self) -> Self

Source§

fn acospi(x: Self) -> Self

Source§

fn atanpi(x: Self) -> Self

Source§

fn atan2pi(y: Self, x: Self) -> Self

Source§

fn sinh(x: Self) -> Self

Source§

fn cosh(x: Self) -> Self

Source§

fn sinh_cosh(x: Self) -> (Self, Self)

Source§

fn tanh(x: Self) -> Self

Source§

fn asinh(x: Self) -> Self

Source§

fn acosh(x: Self) -> Self

Source§

fn atanh(x: Self) -> Self

Source§

fn tgamma(x: Self) -> Self

Source§

fn lgamma(x: Self) -> (Self, i8)

Implementors§