Trait Float

Source
pub trait Float: CType<Float = Self> {
Show 15 methods // Required methods fn is_inf(self) -> bool; fn is_nan(self) -> bool; fn exp(self) -> Self; fn ln(self) -> Self; fn log(self, base: Self) -> Self; fn sin(self) -> Self; fn asin(self) -> Self; fn sinh(self) -> Self; fn cos(self) -> Self; fn acos(self) -> Self; fn cosh(self) -> Self; fn tan(self) -> Self; fn atan(self) -> Self; fn tanh(self) -> Self; fn to_f64(self) -> f64;
}
Expand description

A floating-point CType

Required Methods§

Source

fn is_inf(self) -> bool

Return true if this Float is infinite (positive or negative infinity).

Source

fn is_nan(self) -> bool

Return true if this Float is not a number (e.g. a float representation of 1.0 / 0.0).

Source

fn exp(self) -> Self

Exponentiate this number (equivalent to consts::E.pow(self)).

Source

fn ln(self) -> Self

Return the natural logarithm of this Float.

Source

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

Calculate the logarithm of this Float w/r/t the given base.

Source

fn sin(self) -> Self

Return the sine of this Float (in radians).

Source

fn asin(self) -> Self

Return the arcsine of this Float (in radians).

Source

fn sinh(self) -> Self

Return the hyperbolic sine of this Float (in radians).

Source

fn cos(self) -> Self

Return the cosine of this Float (in radians).

Source

fn acos(self) -> Self

Return the arcsine of this Float (in radians).

Source

fn cosh(self) -> Self

Return the hyperbolic cosine of this Float (in radians).

Source

fn tan(self) -> Self

Return the tangent of this Float (in radians).

Source

fn atan(self) -> Self

Return the arctangent of this Float (in radians).

Source

fn tanh(self) -> Self

Return the hyperbolic tangent of this Float (in radians).

Source

fn to_f64(self) -> f64

Cast this Float to an f64.

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

Source§

fn is_inf(self) -> bool

Source§

fn is_nan(self) -> bool

Source§

fn exp(self) -> Self

Source§

fn ln(self) -> Self

Source§

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

Source§

fn sin(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn sinh(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn cosh(self) -> Self

Source§

fn tan(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn tanh(self) -> Self

Source§

fn to_f64(self) -> f64

Source§

impl Float for f64

Source§

fn is_inf(self) -> bool

Source§

fn is_nan(self) -> bool

Source§

fn exp(self) -> Self

Source§

fn ln(self) -> Self

Source§

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

Source§

fn sin(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn sinh(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn cosh(self) -> Self

Source§

fn tan(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn tanh(self) -> Self

Source§

fn to_f64(self) -> f64

Implementors§