decorum

Trait Real

Source
pub trait Real:
    Copy
    + Neg<Output = Self>
    + Num
    + PartialOrd
    + Signed {
Show 16 associated constants and 34 methods const E: Self; const PI: Self; const FRAC_1_PI: Self; const FRAC_2_PI: Self; const FRAC_2_SQRT_PI: Self; const FRAC_PI_2: Self; const FRAC_PI_3: Self; const FRAC_PI_4: Self; const FRAC_PI_6: Self; const FRAC_PI_8: Self; const SQRT_2: Self; const FRAC_1_SQRT_2: Self; const LN_2: Self; const LN_10: Self; const LOG2_E: Self; const LOG10_E: Self; // Required methods fn floor(self) -> Self; fn ceil(self) -> Self; fn round(self) -> Self; fn trunc(self) -> Self; fn fract(self) -> Self; fn recip(self) -> Self; fn mul_add(self, a: Self, b: Self) -> Self; fn powi(self, n: i32) -> Self; fn powf(self, n: Self) -> Self; fn sqrt(self) -> Self; fn cbrt(self) -> Self; fn exp(self) -> Self; fn exp2(self) -> Self; fn exp_m1(self) -> Self; fn log(self, base: Self) -> Self; fn ln(self) -> Self; fn log2(self) -> Self; fn log10(self) -> Self; fn ln_1p(self) -> Self; fn hypot(self, other: 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, other: Self) -> Self; fn sin_cos(self) -> (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;
}
Expand description

Types that can represent real numbers.

Provides values and operations that generally apply to real numbers. As such, this trait is implemented by types using floating-point representations, but this trait is a general numeric trait and can be implemented by other numeric types as well.

Some members of this trait depend on the standard library and the std feature.

Required Associated Constants§

Source

const E: Self

Source

const PI: Self

Source

const FRAC_1_PI: Self

Source

const FRAC_2_PI: Self

Source

const FRAC_2_SQRT_PI: Self

Source

const FRAC_PI_2: Self

Source

const FRAC_PI_3: Self

Source

const FRAC_PI_4: Self

Source

const FRAC_PI_6: Self

Source

const FRAC_PI_8: Self

Source

const SQRT_2: Self

Source

const FRAC_1_SQRT_2: Self

Source

const LN_2: Self

Source

const LN_10: Self

Source

const LOG2_E: Self

Source

const LOG10_E: Self

Required Methods§

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 recip(self) -> Self

Source

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

Source

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

Source

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

Source

fn sqrt(self) -> Self

Source

fn cbrt(self) -> Self

Source

fn exp(self) -> Self

Source

fn exp2(self) -> Self

Source

fn exp_m1(self) -> Self

Source

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

Source

fn ln(self) -> Self

Source

fn log2(self) -> Self

Source

fn log10(self) -> Self

Source

fn ln_1p(self) -> Self

Source

fn hypot(self, other: 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, other: Self) -> Self

Source

fn sin_cos(self) -> (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

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

Source§

const E: Self = 2.71828175f32

Source§

const PI: Self = 3.14159274f32

Source§

const FRAC_1_PI: Self = 0.318309873f32

Source§

const FRAC_2_PI: Self = 0.636619746f32

Source§

const FRAC_2_SQRT_PI: Self = 1.12837923f32

Source§

const FRAC_PI_2: Self = 1.57079637f32

Source§

const FRAC_PI_3: Self = 1.04719758f32

Source§

const FRAC_PI_4: Self = 0.785398185f32

Source§

const FRAC_PI_6: Self = 0.52359879f32

Source§

const FRAC_PI_8: Self = 0.392699093f32

Source§

const SQRT_2: Self = 1.41421354f32

Source§

const FRAC_1_SQRT_2: Self = 0.707106769f32

Source§

const LN_2: Self = 0.693147182f32

Source§

const LN_10: Self = 2.30258512f32

Source§

const LOG2_E: Self = 1.44269502f32

Source§

const LOG10_E: Self = 0.434294492f32

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 recip(self) -> Self

Source§

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

Source§

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

Source§

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

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

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

Source§

fn ln(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn ln_1p(self) -> Self

Source§

fn hypot(self, other: 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, other: Self) -> Self

Source§

fn sin_cos(self) -> (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§

impl Real for f64

Source§

const E: Self = 2.7182818284590451f64

Source§

const PI: Self = 3.1415926535897931f64

Source§

const FRAC_1_PI: Self = 0.31830988618379069f64

Source§

const FRAC_2_PI: Self = 0.63661977236758138f64

Source§

const FRAC_2_SQRT_PI: Self = 1.1283791670955126f64

Source§

const FRAC_PI_2: Self = 1.5707963267948966f64

Source§

const FRAC_PI_3: Self = 1.0471975511965979f64

Source§

const FRAC_PI_4: Self = 0.78539816339744828f64

Source§

const FRAC_PI_6: Self = 0.52359877559829893f64

Source§

const FRAC_PI_8: Self = 0.39269908169872414f64

Source§

const SQRT_2: Self = 1.4142135623730951f64

Source§

const FRAC_1_SQRT_2: Self = 0.70710678118654757f64

Source§

const LN_2: Self = 0.69314718055994529f64

Source§

const LN_10: Self = 2.3025850929940459f64

Source§

const LOG2_E: Self = 1.4426950408889634f64

Source§

const LOG10_E: Self = 0.43429448190325182f64

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 recip(self) -> Self

Source§

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

Source§

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

Source§

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

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn exp_m1(self) -> Self

Source§

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

Source§

fn ln(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn ln_1p(self) -> Self

Source§

fn hypot(self, other: 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, other: Self) -> Self

Source§

fn sin_cos(self) -> (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

Implementors§

Source§

impl<T, P> Real for ConstrainedFloat<T, P>
where T: Float + Primitive, P: Constraint<T>,

Source§

const E: Self = _

Source§

const PI: Self = _

Source§

const FRAC_1_PI: Self = _

Source§

const FRAC_2_PI: Self = _

Source§

const FRAC_2_SQRT_PI: Self = _

Source§

const FRAC_PI_2: Self = _

Source§

const FRAC_PI_3: Self = _

Source§

const FRAC_PI_4: Self = _

Source§

const FRAC_PI_6: Self = _

Source§

const FRAC_PI_8: Self = _

Source§

const SQRT_2: Self = _

Source§

const FRAC_1_SQRT_2: Self = _

Source§

const LN_2: Self = _

Source§

const LN_10: Self = _

Source§

const LOG2_E: Self = _

Source§

const LOG10_E: Self = _