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§
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 Associated Types§
Required Methods§
Sourcefn is_nan(self) -> bool
fn is_nan(self) -> bool
See f32::is_nan.
Sourcefn is_infinite(self) -> bool
fn is_infinite(self) -> bool
See f32::is_infinite.
Sourcefn is_finite(self) -> bool
fn is_finite(self) -> bool
See f32::is_finite.
Sourcefn is_subnormal(self) -> bool
fn is_subnormal(self) -> bool
See f32::is_subnormal.
Sourcefn is_normal(self) -> bool
fn is_normal(self) -> bool
See f32::is_normal.
Sourcefn classify(self) -> FpCategory
fn classify(self) -> FpCategory
See f32::classify.
Sourcefn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Sourcefn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
Sourcefn recip(self) -> Self
fn recip(self) -> Self
See f32::recip.
Sourcefn to_degrees(self) -> Self
fn to_degrees(self) -> Self
See f32::to_degrees.
Sourcefn to_radians(self) -> Self
fn to_radians(self) -> Self
See f32::to_radians.
Sourcefn to_bits(self) -> Self::Bits
fn to_bits(self) -> Self::Bits
See f32::to_bits.
Sourcefn from_bits(v: Self::Bits) -> Self
fn from_bits(v: Self::Bits) -> Self
See f32::from_bits.
Sourcefn total_cmp(&self, other: &Self) -> Ordering
fn total_cmp(&self, other: &Self) -> Ordering
See f32::total_cmp.
Sourcefn clamp(self, min: Self, max: Self) -> Self
fn clamp(self, min: Self, max: Self) -> Self
See f32::clamp.
Sourcefn copysign(self, sign: Self) -> Self
fn copysign(self, sign: Self) -> Self
See f32::copysign.
Sourcefn floor(self) -> Self
fn floor(self) -> Self
See f32::floor.
Sourcefn round(self) -> Self
fn round(self) -> Self
See f32::round.
Sourcefn round_ties_even(self) -> Self
fn round_ties_even(self) -> Self
See f32::round_ties_even.
Sourcefn trunc(self) -> Self
fn trunc(self) -> Self
See f32::trunc.
Sourcefn fract(self) -> Self
fn fract(self) -> Self
See f32::fract.
Sourcefn mul_add(self, a: Self, b: Self) -> Self
fn mul_add(self, a: Self, b: Self) -> Self
See f32::mul_add.
Sourcefn log10(self) -> Self
fn log10(self) -> Self
See f32::log10.
Sourcefn hypot(self, other: Self) -> Self
fn hypot(self, other: Self) -> Self
See f32::hypot.
Sourcefn atan2(self, other: Self) -> Self
fn atan2(self, other: Self) -> Self
See f32::atan2.
Sourcefn sin_cos(self) -> (Self, Self)
fn sin_cos(self) -> (Self, Self)
See f32::sin_cos.
Sourcefn exp_m1(self) -> Self
fn exp_m1(self) -> Self
See f32::exp_m1.
Sourcefn ln_1p(self) -> Self
fn ln_1p(self) -> Self
See f32::ln_1p.
Sourcefn asinh(self) -> Self
fn asinh(self) -> Self
See f32::asinh.
Sourcefn acosh(self) -> Self
fn acosh(self) -> Self
See f32::acosh.
Sourcefn atanh(self) -> Self
fn atanh(self) -> Self
See f32::atanh.
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.