RealNumber

Trait RealNumber 

Source
pub trait RealNumber: ScientificNumber + Float {
Show 18 methods // Required methods fn epsilon() -> Self; fn exp(self) -> Self; fn ln(self) -> Self; fn log10(self) -> Self; fn log2(self) -> Self; fn sin(self) -> Self; fn cos(self) -> Self; fn tan(self) -> Self; fn sinh(self) -> Self; fn cosh(self) -> Self; fn tanh(self) -> Self; fn asin(self) -> Self; fn acos(self) -> Self; fn atan(self) -> Self; fn atan2(self, other: Self) -> Self; fn powf(self, n: Self) -> Self; fn powi(self, n: i32) -> Self; fn factorial(self) -> Self;
}
Expand description

A trait for real-valued floating point types

Required Methods§

Source

fn epsilon() -> Self

Returns the machine epsilon (the difference between 1.0 and the least value greater than 1.0)

Source

fn exp(self) -> Self

Exponential function (e^x)

Source

fn ln(self) -> Self

Natural logarithm (ln(x))

Source

fn log10(self) -> Self

Base-10 logarithm

Source

fn log2(self) -> Self

Base-2 logarithm

Source

fn sin(self) -> Self

Sine function

Source

fn cos(self) -> Self

Cosine function

Source

fn tan(self) -> Self

Tangent function

Source

fn sinh(self) -> Self

Hyperbolic sine

Source

fn cosh(self) -> Self

Hyperbolic cosine

Source

fn tanh(self) -> Self

Hyperbolic tangent

Source

fn asin(self) -> Self

Inverse sine

Source

fn acos(self) -> Self

Inverse cosine

Source

fn atan(self) -> Self

Inverse tangent

Source

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

Inverse tangent of y/x with correct quadrant

Source

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

Power function

Source

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

Integer power function

Source

fn factorial(self) -> Self

Factorial function (approximation for non-integers)

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

Source§

fn epsilon() -> Self

Source§

fn exp(self) -> Self

Source§

fn ln(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

fn sinh(self) -> Self

Source§

fn cosh(self) -> Self

Source§

fn tanh(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 powf(self, n: Self) -> Self

Source§

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

Source§

fn factorial(self) -> Self

Source§

impl RealNumber for f64

Source§

fn epsilon() -> Self

Source§

fn exp(self) -> Self

Source§

fn ln(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn log2(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

fn sinh(self) -> Self

Source§

fn cosh(self) -> Self

Source§

fn tanh(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 powf(self, n: Self) -> Self

Source§

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

Source§

fn factorial(self) -> Self

Implementors§