Trait Float

Source
pub trait Float:
    Number
    + From<f32>
    + From<bool>
    + Into<f64> {
    type Bits: Unsigned;
Show 18 associated constants and 52 methods const RADIX: u32; const MANTISSA_DIGITS: u32; const DIGITS: u32; const EPSILON: Self; const MIN_FINITE: Self; const MIN_POSITIVE_SUBNORMAL: Self; const MIN_POSITIVE_NORMAL: Self; const MIN_EXP: i32; const MIN_10_EXP: i32; const MAX_FINITE: Self; const MAX_NEGATIVE_SUBNORMAL: Self; const MAX_NEGATIVE_NORMAL: Self; const MAX_EXP: i32; const MAX_10_EXP: i32; const NAN: Self; const INFINITY: Self; const NEG_INFINITY: Self; const NEG_ZERO: Self; // Required methods fn is_nan(self) -> bool; fn is_infinite(self) -> bool; fn is_finite(self) -> bool; fn is_subnormal(self) -> bool; fn is_normal(self) -> bool; fn classify(self) -> FpCategory; fn is_sign_positive(self) -> bool; fn is_sign_negative(self) -> bool; fn recip(self) -> Self; fn to_degrees(self) -> Self; fn to_radians(self) -> Self; fn max(self, other: Self) -> Self; fn min(self, other: Self) -> Self; fn to_bits(self) -> Self::Bits; fn from_bits(v: Self::Bits) -> Self; fn total_cmp(&self, other: &Self) -> Ordering; fn clamp(self, min: Self, max: Self) -> Self; fn copysign(self, sign: Self) -> Self; fn floor(self) -> Self; fn ceil(self) -> Self; fn round(self) -> Self; fn round_ties_even(self) -> Self; fn trunc(self) -> Self; fn fract(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 exp(self) -> Self; fn exp2(self) -> Self; fn ln(self) -> Self; fn log(self, base: Self) -> Self; fn log2(self) -> Self; fn log10(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 atan2(self, other: 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;
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn is_nan(self) -> bool

Source

fn is_infinite(self) -> bool

Source

fn is_finite(self) -> bool

Source

fn is_subnormal(self) -> bool

Source

fn is_normal(self) -> bool

Source

fn classify(self) -> FpCategory

Source

fn is_sign_positive(self) -> bool

Source

fn is_sign_negative(self) -> bool

Source

fn recip(self) -> Self

Source

fn to_degrees(self) -> Self

Source

fn to_radians(self) -> Self

Source

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

See f32::max.

Source

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

See f32::min.

Source

fn to_bits(self) -> Self::Bits

Source

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

Source

fn total_cmp(&self, other: &Self) -> Ordering

Source

fn clamp(self, min: Self, max: Self) -> Self

Source

fn copysign(self, sign: Self) -> Self

Source

fn floor(self) -> Self

Source

fn ceil(self) -> Self

See f32::ceil.

Source

fn round(self) -> Self

Source

fn round_ties_even(self) -> Self

Source

fn trunc(self) -> Self

Source

fn fract(self) -> Self

Source

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

Source

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

See f32::powi.

Source

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

See f32::powf.

Source

fn sqrt(self) -> Self

See f32::sqrt.

Source

fn exp(self) -> Self

See f32::exp.

Source

fn exp2(self) -> Self

See f32::exp2.

Source

fn ln(self) -> Self

See f32::ln.

Source

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

See f32::log.

Source

fn log2(self) -> Self

See f32::log2.

Source

fn log10(self) -> Self

Source

fn cbrt(self) -> Self

See f32::cbrt.

Source

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

Source

fn sin(self) -> Self

See f32::sin.

Source

fn cos(self) -> Self

See f32::cos.

Source

fn tan(self) -> Self

See f32::tan.

Source

fn asin(self) -> Self

See f32::asin.

Source

fn acos(self) -> Self

See f32::acos.

Source

fn atan(self) -> Self

See f32::atan.

Source

fn atan2(self, other: 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

See f32::sinh.

Source

fn cosh(self) -> Self

See f32::cosh.

Source

fn tanh(self) -> Self

See f32::tanh.

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

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_FINITE: Self = -3.40282347E+38f32

Source§

const MIN_POSITIVE_SUBNORMAL: Self = 1.40129846E-45f32

Source§

const MIN_POSITIVE_NORMAL: Self = 1.17549435E-38f32

Source§

const MIN_EXP: i32 = -125i32

Source§

const MIN_10_EXP: i32 = -37i32

Source§

const MAX_FINITE: Self = 3.40282347E+38f32

Source§

const MAX_NEGATIVE_SUBNORMAL: Self = -1.40129846E-45f32

Source§

const MAX_NEGATIVE_NORMAL: Self = -1.17549435E-38f32

Source§

const MAX_EXP: i32 = 128i32

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§

const NEG_ZERO: Self = -0f32

Source§

type Bits = u32

Source§

fn is_nan(self) -> bool

Source§

fn is_infinite(self) -> bool

Source§

fn is_finite(self) -> bool

Source§

fn is_subnormal(self) -> bool

Source§

fn is_normal(self) -> bool

Source§

fn classify(self) -> FpCategory

Source§

fn is_sign_positive(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn recip(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn to_radians(self) -> Self

Source§

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

Source§

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

Source§

fn to_bits(self) -> Self::Bits

Source§

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

Source§

fn total_cmp(&self, other: &Self) -> Ordering

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

fn copysign(self, sign: Self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn round(self) -> Self

Source§

fn round_ties_even(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(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 exp(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn ln(self) -> Self

Source§

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

Source§

fn log2(self) -> Self

Source§

fn log10(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 atan2(self, other: 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§

impl Float for f64

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_FINITE: Self = -1.7976931348623157E+308f64

Source§

const MIN_POSITIVE_SUBNORMAL: Self = 4.9406564584124654E-324f64

Source§

const MIN_POSITIVE_NORMAL: Self = 2.2250738585072014E-308f64

Source§

const MIN_EXP: i32 = -1_021i32

Source§

const MIN_10_EXP: i32 = -307i32

Source§

const MAX_FINITE: Self = 1.7976931348623157E+308f64

Source§

const MAX_NEGATIVE_SUBNORMAL: Self = -4.9406564584124654E-324f64

Source§

const MAX_NEGATIVE_NORMAL: Self = -2.2250738585072014E-308f64

Source§

const MAX_EXP: i32 = 1_024i32

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§

const NEG_ZERO: Self = -0f64

Source§

type Bits = u64

Source§

fn is_nan(self) -> bool

Source§

fn is_infinite(self) -> bool

Source§

fn is_finite(self) -> bool

Source§

fn is_subnormal(self) -> bool

Source§

fn is_normal(self) -> bool

Source§

fn classify(self) -> FpCategory

Source§

fn is_sign_positive(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn recip(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn to_radians(self) -> Self

Source§

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

Source§

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

Source§

fn to_bits(self) -> Self::Bits

Source§

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

Source§

fn total_cmp(&self, other: &Self) -> Ordering

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

fn copysign(self, sign: Self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn round(self) -> Self

Source§

fn round_ties_even(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(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 exp(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn ln(self) -> Self

Source§

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

Source§

fn log2(self) -> Self

Source§

fn log10(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 atan2(self, other: 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

Implementors§