Trait Float

Source
pub trait Float: Signed + From<f32> {
    type Bits;
Show 15 associated constants and 40 methods const HALF: Self; const RADIX: u32; const MANTISSA_DIGITS: u32; const DIGITS: u32; const EPSILON: Self; const MIN: Self; const MIN_POSITIVE: Self; const MAX: Self; const MIN_EXP: i32; const MAX_EXP: i32; const MIN_10_EXP: i32; const MAX_10_EXP: i32; const NAN: Self; const INFINITY: Self; const NEG_INFINITY: Self; // Required methods fn floor(self) -> Self; fn ceil(self) -> Self; fn round(self) -> Self; fn trunc(self) -> Self; fn fract(self) -> Self; fn copysign(self, other: Self) -> Self; fn mul_add(self, a: Self, b: Self) -> Self; fn div_euclid(self, other: Self) -> Self; fn rem_euclid(self, other: Self) -> Self; fn powi(self, pow: i32) -> Self; fn powf(self, pow: Self) -> Self; fn sqrt(self) -> Self; fn exp(self) -> Self; fn exp2(self) -> Self; fn ln(self) -> Self; fn log(self, base: Self) -> Self; fn log10(self) -> Self; fn log2(self) -> Self; fn cbrt(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 sin_cos(self) -> (Self, Self); fn exp_m1(self) -> Self; fn ln_1p(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 recip(self) -> Self; fn to_radians(self) -> Self; fn to_degrees(self) -> Self; fn from_bits(bits: Self::Bits) -> Self; fn to_bits(self) -> Self::Bits;
}

Required Associated Constants§

Source

const HALF: Self

Source

const RADIX: u32

Source

const MANTISSA_DIGITS: u32

Source

const DIGITS: u32

Source

const EPSILON: Self

Source

const MIN: Self

Source

const MIN_POSITIVE: Self

Source

const MAX: Self

Source

const MIN_EXP: i32

Source

const MAX_EXP: i32

Source

const MIN_10_EXP: i32

Source

const MAX_10_EXP: i32

Source

const NAN: Self

Source

const INFINITY: Self

Source

const NEG_INFINITY: Self

Required Associated Types§

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn sqrt(self) -> Self

Source

fn exp(self) -> Self

Source

fn exp2(self) -> Self

Source

fn ln(self) -> Self

Source

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

Source

fn log10(self) -> Self

Source

fn log2(self) -> Self

Source

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

Source

fn exp_m1(self) -> Self

Source

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

Source

fn to_radians(self) -> Self

Source

fn to_degrees(self) -> Self

Source

fn from_bits(bits: Self::Bits) -> Self

Source

fn to_bits(self) -> Self::Bits

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§

const HALF: Self = 0.5f32

Source§

const RADIX: u32 = 2u32

Source§

const MANTISSA_DIGITS: u32 = 24u32

Source§

const DIGITS: u32 = 6u32

Source§

const EPSILON: Self = 1.1920929E-7f32

Source§

const MIN: Self = -3.40282347E+38f32

Source§

const MIN_POSITIVE: Self = 1.17549435E-38f32

Source§

const MAX: Self = 3.40282347E+38f32

Source§

const MIN_EXP: i32 = -125i32

Source§

const MAX_EXP: i32 = 128i32

Source§

const MIN_10_EXP: i32 = -37i32

Source§

const MAX_10_EXP: i32 = 38i32

Source§

const NAN: Self = NaN_f32

Source§

const INFINITY: Self = +Inf_f32

Source§

const NEG_INFINITY: Self = -Inf_f32

Source§

type Bits = u32

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn sqrt(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn ln(self) -> Self

Source§

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

Source§

fn log10(self) -> Self

Source§

fn log2(self) -> Self

Source§

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

Source§

fn exp_m1(self) -> Self

Source§

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

Source§

fn to_radians(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn from_bits(bits: Self::Bits) -> Self

Source§

fn to_bits(self) -> Self::Bits

Source§

impl Float for f64

Source§

const HALF: Self = 0.5f64

Source§

const RADIX: u32 = 2u32

Source§

const MANTISSA_DIGITS: u32 = 53u32

Source§

const DIGITS: u32 = 15u32

Source§

const EPSILON: Self = 2.2204460492503131E-16f64

Source§

const MIN: Self = -1.7976931348623157E+308f64

Source§

const MIN_POSITIVE: Self = 2.2250738585072014E-308f64

Source§

const MAX: Self = 1.7976931348623157E+308f64

Source§

const MIN_EXP: i32 = -1_021i32

Source§

const MAX_EXP: i32 = 1_024i32

Source§

const MIN_10_EXP: i32 = -307i32

Source§

const MAX_10_EXP: i32 = 308i32

Source§

const NAN: Self = NaN_f64

Source§

const INFINITY: Self = +Inf_f64

Source§

const NEG_INFINITY: Self = -Inf_f64

Source§

type Bits = u64

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn sqrt(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn ln(self) -> Self

Source§

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

Source§

fn log10(self) -> Self

Source§

fn log2(self) -> Self

Source§

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

Source§

fn exp_m1(self) -> Self

Source§

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

Source§

fn to_radians(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn from_bits(bits: Self::Bits) -> Self

Source§

fn to_bits(self) -> Self::Bits

Implementors§