Float

Trait Float 

Source
pub unsafe trait Float
where Self: Float + 'static + Any + CloneToUninit + Copy + Debug + Default + FloatToInt<i128> + FloatToInt<i16> + FloatToInt<i32> + FloatToInt<i64> + FloatToInt<i8> + FloatToInt<isize> + FloatToInt<u128> + FloatToInt<u16> + FloatToInt<u32> + FloatToInt<u64> + FloatToInt<u8> + FloatToInt<usize> + Freeze + From<bool> + From<i8> + From<u8> + PartialEq + PartialOrd + Product + RefUnwindSafe + Send + Sum + Sync + Thin + ToOwned + TryFrom<bool, Error = Infallible> + TryFrom<i8, Error = Infallible> + TryFrom<u8, Error = Infallible> + Unpin + UnwindSafe + UseCloned + Add<Output = Self> + Div<Output = Self> + Mul<Output = Self> + Neg<Output = Self> + Rem<Output = Self> + Sub<Output = Self> + AddAssign + DivAssign + MulAssign + RemAssign + SubAssign,
{ type Bytes: Array<Scalar = u8> + 'static + Any + CloneToUninit + ConstParamTy_ + Copy + Debug + Eq + Freeze + Hash + Ord + PartialEq + PartialEq<[u8]> + PartialOrd + RefUnwindSafe + Send + Sync + ToOwned + Unpin + UnwindSafe; type Bits: Uint<Bytes = Self::Bytes>;
Show 37 associated constants and 40 methods const RADIX: u32; const MANTISSA_DIGITS: u32; const DIGITS: u32; const EPSILON: Self; const MIN: Self; const MIN_POSITIVE: Self; const MAX: Self; const INFINITY: Self; const NEG_INFINITY: Self; const NAN: Self; const EGAMMA: Self; const PHI: Self; const E: Self; const PI: Self; const TAU: Self; const LOG2_10: Self; const LOG2_E: Self; const LN_2: Self; const LN_10: Self; const LOG10_2: Self; const LOG10_E: Self; const SQRT_2: Self; const SQRT_3: Self; const FRAC_1_PI: Self; const FRAC_1_SQRT_2: Self; const FRAC_1_SQRT_3: Self; const FRAC_1_SQRT_PI: Self; const FRAC_1_SQRT_2PI: Self; const FRAC_2_PI: Self; const FRAC_2_SQRT_PI: Self; const FRAC_PI_2: Self; const FRAC_PI_3: Self; const FRAC_PI_4: Self; const FRAC_PI_6: Self; const FRAC_PI_8: Self; const ZERO: Self; const ONE: Self; // Required methods fn from_f16(value: f16) -> Self; fn from_f64_lossy(value: f64) -> Self; fn from_f128_lossy(value: f128) -> Self; fn from_ne_bytes(bytes: Self::Bytes) -> Self; fn from_le_bytes(bytes: Self::Bytes) -> Self; fn from_be_bytes(bytes: Self::Bytes) -> Self; fn from_bits(bits: Self::Bits) -> Self; fn abs(self) -> Self; fn recip(self) -> Self; fn midpoint(self, rhs: Self) -> Self; fn to_radians(self) -> Self; fn to_degrees(self) -> Self; fn next_down(self) -> Self; fn next_up(self) -> Self; fn signum(self) -> Self; fn copysign(self, sign: Self) -> Self; fn algebraic_add(self, rhs: Self) -> Self; fn algebraic_sub(self, rhs: Self) -> Self; fn algebraic_mul(self, rhs: Self) -> Self; fn algebraic_div(self, rhs: Self) -> Self; fn algebraic_rem(self, rhs: Self) -> Self; fn classify(self) -> FpCategory; fn is_nan(self) -> bool; fn is_infinite(self) -> bool; fn is_finite(self) -> bool; fn is_normal(self) -> bool; fn is_subnormal(self) -> bool; fn is_sign_negative(self) -> bool; fn is_sign_positive(self) -> bool; fn clamp(self, min: Self, max: Self) -> Self; fn min(self, rhs: Self) -> Self; fn max(self, rhs: Self) -> Self; fn minimum(self, rhs: Self) -> Self; fn maximum(self, rhs: Self) -> Self; fn total_cmp(&self, rhs: &Self) -> Ordering; unsafe fn to_int_unchecked<T>(self) -> T where Self: FloatToInt<T>; fn to_bits(self) -> Self::Bits; fn to_ne_bytes(self) -> Self::Bytes; fn to_le_bytes(self) -> Self::Bytes; fn to_be_bytes(self) -> Self::Bytes;
}
Expand description

A generic, floating-point real.

This trait abstracts the interfaces defined by f16, f32, f64, and f128 so that these may be used as a single type.

The following trait(s) are not required due to some floating-point types not implementing them:

These trait(s) will be required when standard support arrives.

See also FloatLeast32 and FloatLeast64. See also StdFloat.

§Safety

Bits must be an unsigned, integral type of the same width as Self so that transmutations between the two is always valid.

Furthermore, all items must behave exactly as their standard counterparts.

Required Associated Constants§

Source

const RADIX: u32

See f64::RADIX.

Source

const MANTISSA_DIGITS: u32

Source

const DIGITS: u32

See f64::DIGITS.

Source

const EPSILON: Self

See f64::EPSILON.

Source

const MIN: Self

See f64::MIN.

Source

const MIN_POSITIVE: Self

Source

const MAX: Self

See f64::MAX.

Source

const INFINITY: Self

See f64::INFINITY.

Source

const NEG_INFINITY: Self

Source

const NAN: Self

See f64::NAN.

Source

const EGAMMA: Self

Available on crate feature nightly_backports only.

See f64::consts::EGAMMA.

Source

const PHI: Self

Available on crate feature nightly_backports only.

See f64::consts::PHI.

Source

const E: Self

See f64::consts::E.

Source

const PI: Self

See f64::consts::PI.

Source

const TAU: Self

See f64::consts::TAU.

Source

const LOG2_10: Self

Source

const LOG2_E: Self

See f64::consts::LOG2_E.

Source

const LN_2: Self

See f64::consts::LN_2.

Source

const LN_10: Self

See f64::consts::LN_10.

Source

const LOG10_2: Self

Source

const LOG10_E: Self

Source

const SQRT_2: Self

See f64::consts::SQRT_2.

Source

const SQRT_3: Self

Available on crate feature nightly_backports only.

See f64::consts::SQRT_3.

Source

const FRAC_1_PI: Self

Source

const FRAC_1_SQRT_2: Self

Source

const FRAC_1_SQRT_3: Self

Available on crate feature nightly_backports only.
Source

const FRAC_1_SQRT_PI: Self

Available on crate feature nightly_backports only.
Source

const FRAC_1_SQRT_2PI: Self

Available on crate feature nightly_backports only.
Source

const FRAC_2_PI: Self

Source

const FRAC_2_SQRT_PI: Self

Source

const FRAC_PI_2: Self

Source

const FRAC_PI_3: Self

Source

const FRAC_PI_4: Self

Source

const FRAC_PI_6: Self

Source

const FRAC_PI_8: Self

Source

const ZERO: Self

Equivalent to Self::from_f16(0.0).

§Examples
use multitype::Float;

let v0 = f32::ZERO;
let v1 = 0.0f32;

assert_eq!(v0, v1);
Source

const ONE: Self

Equivalent to Self::from_f16(1.0).

§Examples
use multitype::Float;

let v0 = f32::ONE;
let v1 = 1.0f32;

assert_eq!(v0, v1);

Required Associated Types§

Source

type Bytes: Array<Scalar = u8> + 'static + Any + CloneToUninit + ConstParamTy_ + Copy + Debug + Eq + Freeze + Hash + Ord + PartialEq + PartialEq<[u8]> + PartialOrd + RefUnwindSafe + Send + Sync + ToOwned + Unpin + UnwindSafe

The array type that represents the bytes of this type.

This type is always [u8; size_of::<Self>].

Source

type Bits: Uint<Bytes = Self::Bytes>

The scalar type that represents the bits of this type.

Required Methods§

Source

fn from_f16(value: f16) -> Self

Available on crate feature f16 only.

Losslessly constructs a new, floating-point real from an f16 value.

When f32 implements From<f16>, this constructor will be removed.

Source

fn from_f64_lossy(value: f64) -> Self

Equivalent to value as Self.

Note that when f128 stabilises (see #116909), this constructor may be depcreated in favour of from_f128_lossy.

§Examples
use multitype::Float;

let v0 = 0.062_500f64 as f32;
let v1 = f32::from_f64_lossy(0.062_500);

assert_eq!(v0.to_bits(), v1.to_bits());
Source

fn from_f128_lossy(value: f128) -> Self

Available on crate feature f128 only.

Equivalent to value as Self.

§Examples

use multitype::Float;

let v0 = 0.062_500f128 as f32;
let v1 = f32::from_f128_lossy(0.062_500);

assert_eq!(v0.to_bits(), v1.to_bits());
Source

fn from_ne_bytes(bytes: Self::Bytes) -> Self

Source

fn from_le_bytes(bytes: Self::Bytes) -> Self

Source

fn from_be_bytes(bytes: Self::Bytes) -> Self

Source

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

See f64::from_bits.

Source

fn abs(self) -> Self

See f64::abs.

Source

fn recip(self) -> Self

See f64::recip.

Source

fn midpoint(self, rhs: Self) -> Self

See f64::midpoint.

Source

fn to_radians(self) -> Self

Source

fn to_degrees(self) -> Self

Source

fn next_down(self) -> Self

See f64::next_down.

Source

fn next_up(self) -> Self

See f64::next_up.

Source

fn signum(self) -> Self

See f64::signum.

Source

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

See f64::copysign.

Source

fn algebraic_add(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source

fn algebraic_sub(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source

fn algebraic_mul(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source

fn algebraic_div(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source

fn algebraic_rem(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source

fn classify(self) -> FpCategory

See f64::classify.

Source

fn is_nan(self) -> bool

See f64::is_nan.

Source

fn is_infinite(self) -> bool

Source

fn is_finite(self) -> bool

See f64::is_finite.

Source

fn is_normal(self) -> bool

See f64::is_normal.

Source

fn is_subnormal(self) -> bool

Source

fn is_sign_negative(self) -> bool

Source

fn is_sign_positive(self) -> bool

Source

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

See f64::clamp.

Source

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

See f64::min.

Source

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

See f64::max.

Source

fn minimum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.

See f64::minimum.

Source

fn maximum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.

See f64::maximum.

Source

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

See f64::total_cmp.

Source

unsafe fn to_int_unchecked<T>(self) -> T
where Self: FloatToInt<T>,

See f64::to_int_unchecked.

Our multitype::FloatToInt<T> trait can be expected to be as equivalent to core::convert::FloatToInt<T> as possible.

Source

fn to_bits(self) -> Self::Bits

See f64::to_bits.

Source

fn to_ne_bytes(self) -> Self::Bytes

Source

fn to_le_bytes(self) -> Self::Bytes

Source

fn to_be_bytes(self) -> Self::Bytes

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 f16

Available on crate feature f16 only.
Source§

const RADIX: u32 = 2u32

Source§

const MANTISSA_DIGITS: u32 = 11u32

Source§

const DIGITS: u32 = 3u32

Source§

const EPSILON: Self = 9.7656E-4f16

Source§

const MIN: Self = -65504f16

Source§

const MIN_POSITIVE: Self = 6.1035E-5f16

Source§

const MAX: Self = 65504f16

Source§

const ZERO: Self = 0f16

Source§

const ONE: Self = 1f16

Source§

const INFINITY: Self = +Inf_f16

Source§

const NEG_INFINITY: Self = -Inf_f16

Source§

const NAN: Self = NaN_f16

Source§

const EGAMMA: Self = 0.57715f16

Available on crate feature nightly_backports only.
Source§

const PHI: Self = 1.6182f16

Available on crate feature nightly_backports only.
Source§

const E: Self = 2.7188f16

Source§

const PI: Self = 3.1406f16

Source§

const TAU: Self = 6.2813f16

Source§

const LOG2_10: Self = 3.3223f16

Source§

const LOG2_E: Self = 1.4424f16

Source§

const LN_2: Self = 0.69336f16

Source§

const LN_10: Self = 2.3027f16

Source§

const LOG10_2: Self = 0.30103f16

Source§

const LOG10_E: Self = 0.43433f16

Source§

const SQRT_2: Self = 1.4141f16

Source§

const SQRT_3: Self = 1.7324f16

Available on crate feature nightly_backports only.
Source§

const FRAC_1_PI: Self = 0.31836f16

Source§

const FRAC_1_SQRT_2: Self = 0.70703f16

Source§

const FRAC_1_SQRT_3: Self = 0.57715f16

Available on crate feature nightly_backports only.
Source§

const FRAC_1_SQRT_PI: Self = 0.56396f16

Available on crate feature nightly_backports only.
Source§

const FRAC_1_SQRT_2PI: Self = 0.39893f16

Available on crate feature nightly_backports only.
Source§

const FRAC_2_PI: Self = 0.63672f16

Source§

const FRAC_2_SQRT_PI: Self = 1.1279f16

Source§

const FRAC_PI_2: Self = 1.5703f16

Source§

const FRAC_PI_3: Self = 1.0469f16

Source§

const FRAC_PI_4: Self = 0.78515f16

Source§

const FRAC_PI_6: Self = 0.52344f16

Source§

const FRAC_PI_8: Self = 0.39258f16

Source§

type Bytes = [u8; 2]

Source§

type Bits = u16

Source§

fn from_f16(value: f16) -> Self

Source§

fn from_f64_lossy(value: f64) -> Self

Source§

fn from_f128_lossy(value: f128) -> Self

Available on crate feature f128 only.
Source§

fn from_ne_bytes(bytes: Self::Bytes) -> Self

Source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

Source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

Source§

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

Source§

fn abs(self) -> Self

Source§

fn recip(self) -> Self

Source§

fn midpoint(self, rhs: Self) -> Self

Source§

fn to_radians(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn next_down(self) -> Self

Source§

fn next_up(self) -> Self

Source§

fn signum(self) -> Self

Source§

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

Source§

fn algebraic_add(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_sub(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_mul(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_div(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_rem(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn classify(self) -> FpCategory

Source§

fn is_nan(self) -> bool

Source§

fn is_infinite(self) -> bool

Source§

fn is_finite(self) -> bool

Source§

fn is_normal(self) -> bool

Source§

fn is_subnormal(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn is_sign_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn minimum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn maximum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

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

Source§

unsafe fn to_int_unchecked<T>(self) -> T
where Self: FloatToInt<T>,

Source§

fn to_ne_bytes(self) -> Self::Bytes

Source§

fn to_le_bytes(self) -> Self::Bytes

Source§

fn to_be_bytes(self) -> Self::Bytes

Source§

fn to_bits(self) -> Self::Bits

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

Source§

const MIN_POSITIVE: Self = 1.17549435E-38f32

Source§

const MAX: Self = 3.40282347E+38f32

Source§

const ZERO: Self = 0f32

Source§

const ONE: Self = 1f32

Source§

const INFINITY: Self = +Inf_f32

Source§

const NEG_INFINITY: Self = -Inf_f32

Source§

const NAN: Self = NaN_f32

Source§

const EGAMMA: Self = 0.577215672f32

Available on crate feature nightly_backports only.
Source§

const PHI: Self = 1.61803401f32

Available on crate feature nightly_backports only.
Source§

const E: Self = 2.71828175f32

Source§

const PI: Self = 3.14159274f32

Source§

const TAU: Self = 6.28318548f32

Source§

const LOG2_10: Self = 3.32192802f32

Source§

const LOG2_E: Self = 1.44269502f32

Source§

const LN_2: Self = 0.693147182f32

Source§

const LN_10: Self = 2.30258512f32

Source§

const LOG10_2: Self = 0.30103001f32

Source§

const LOG10_E: Self = 0.434294492f32

Source§

const SQRT_2: Self = 1.41421354f32

Source§

const SQRT_3: Self = 1.73205078f32

Available on crate feature nightly_backports only.
Source§

const FRAC_1_PI: Self = 0.318309873f32

Source§

const FRAC_1_SQRT_2: Self = 0.707106769f32

Source§

const FRAC_1_SQRT_3: Self = 0.577350259f32

Available on crate feature nightly_backports only.
Source§

const FRAC_1_SQRT_PI: Self = 0.564189613f32

Available on crate feature nightly_backports only.
Source§

const FRAC_1_SQRT_2PI: Self = 0.398942292f32

Available on crate feature nightly_backports only.
Source§

const FRAC_2_PI: Self = 0.636619746f32

Source§

const FRAC_2_SQRT_PI: Self = 1.12837923f32

Source§

const FRAC_PI_2: Self = 1.57079637f32

Source§

const FRAC_PI_3: Self = 1.04719758f32

Source§

const FRAC_PI_4: Self = 0.785398185f32

Source§

const FRAC_PI_6: Self = 0.52359879f32

Source§

const FRAC_PI_8: Self = 0.392699093f32

Source§

type Bytes = [u8; 4]

Source§

type Bits = u32

Source§

fn from_f16(value: f16) -> Self

Available on crate feature f16 only.
Source§

fn from_f64_lossy(value: f64) -> Self

Source§

fn from_f128_lossy(value: f128) -> Self

Available on crate feature f128 only.
Source§

fn from_ne_bytes(bytes: Self::Bytes) -> Self

Source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

Source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

Source§

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

Source§

fn abs(self) -> Self

Source§

fn recip(self) -> Self

Source§

fn midpoint(self, rhs: Self) -> Self

Source§

fn to_radians(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn next_down(self) -> Self

Source§

fn next_up(self) -> Self

Source§

fn signum(self) -> Self

Source§

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

Source§

fn algebraic_add(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_sub(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_mul(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_div(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_rem(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn classify(self) -> FpCategory

Source§

fn is_nan(self) -> bool

Source§

fn is_infinite(self) -> bool

Source§

fn is_finite(self) -> bool

Source§

fn is_normal(self) -> bool

Source§

fn is_subnormal(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn is_sign_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn minimum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn maximum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

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

Source§

unsafe fn to_int_unchecked<T>(self) -> T
where Self: FloatToInt<T>,

Source§

fn to_ne_bytes(self) -> Self::Bytes

Source§

fn to_le_bytes(self) -> Self::Bytes

Source§

fn to_be_bytes(self) -> Self::Bytes

Source§

fn to_bits(self) -> Self::Bits

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

Source§

const MIN_POSITIVE: Self = 2.2250738585072014E-308f64

Source§

const MAX: Self = 1.7976931348623157E+308f64

Source§

const ZERO: Self = 0f64

Source§

const ONE: Self = 1f64

Source§

const INFINITY: Self = +Inf_f64

Source§

const NEG_INFINITY: Self = -Inf_f64

Source§

const NAN: Self = NaN_f64

Source§

const EGAMMA: Self = 0.57721566490153287f64

Available on crate feature nightly_backports only.
Source§

const PHI: Self = 1.6180339887498949f64

Available on crate feature nightly_backports only.
Source§

const E: Self = 2.7182818284590451f64

Source§

const PI: Self = 3.1415926535897931f64

Source§

const TAU: Self = 6.2831853071795862f64

Source§

const LOG2_10: Self = 3.3219280948873622f64

Source§

const LOG2_E: Self = 1.4426950408889634f64

Source§

const LN_2: Self = 0.69314718055994529f64

Source§

const LN_10: Self = 2.3025850929940459f64

Source§

const LOG10_2: Self = 0.3010299956639812f64

Source§

const LOG10_E: Self = 0.43429448190325182f64

Source§

const SQRT_2: Self = 1.4142135623730951f64

Source§

const SQRT_3: Self = 1.7320508075688772f64

Available on crate feature nightly_backports only.
Source§

const FRAC_1_PI: Self = 0.31830988618379069f64

Source§

const FRAC_1_SQRT_2: Self = 0.70710678118654757f64

Source§

const FRAC_1_SQRT_3: Self = 0.57735026918962573f64

Available on crate feature nightly_backports only.
Source§

const FRAC_1_SQRT_PI: Self = 0.56418958354775628f64

Available on crate feature nightly_backports only.
Source§

const FRAC_1_SQRT_2PI: Self = 0.3989422804014327f64

Available on crate feature nightly_backports only.
Source§

const FRAC_2_PI: Self = 0.63661977236758138f64

Source§

const FRAC_2_SQRT_PI: Self = 1.1283791670955126f64

Source§

const FRAC_PI_2: Self = 1.5707963267948966f64

Source§

const FRAC_PI_3: Self = 1.0471975511965979f64

Source§

const FRAC_PI_4: Self = 0.78539816339744828f64

Source§

const FRAC_PI_6: Self = 0.52359877559829893f64

Source§

const FRAC_PI_8: Self = 0.39269908169872414f64

Source§

type Bytes = [u8; 8]

Source§

type Bits = u64

Source§

fn from_f16(value: f16) -> Self

Available on crate feature f16 only.
Source§

fn from_f64_lossy(value: f64) -> Self

Source§

fn from_f128_lossy(value: f128) -> Self

Available on crate feature f128 only.
Source§

fn from_ne_bytes(bytes: Self::Bytes) -> Self

Source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

Source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

Source§

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

Source§

fn abs(self) -> Self

Source§

fn recip(self) -> Self

Source§

fn midpoint(self, rhs: Self) -> Self

Source§

fn to_radians(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn next_down(self) -> Self

Source§

fn next_up(self) -> Self

Source§

fn signum(self) -> Self

Source§

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

Source§

fn algebraic_add(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_sub(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_mul(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_div(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_rem(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn classify(self) -> FpCategory

Source§

fn is_nan(self) -> bool

Source§

fn is_infinite(self) -> bool

Source§

fn is_finite(self) -> bool

Source§

fn is_normal(self) -> bool

Source§

fn is_subnormal(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn is_sign_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn minimum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn maximum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

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

Source§

unsafe fn to_int_unchecked<T>(self) -> T
where Self: FloatToInt<T>,

Source§

fn to_ne_bytes(self) -> Self::Bytes

Source§

fn to_le_bytes(self) -> Self::Bytes

Source§

fn to_be_bytes(self) -> Self::Bytes

Source§

fn to_bits(self) -> Self::Bits

Source§

impl Float for f128

Available on crate feature f128 only.
Source§

const RADIX: u32 = 2u32

Source§

const MANTISSA_DIGITS: u32 = 113u32

Source§

const DIGITS: u32 = 33u32

Source§

const EPSILON: Self = 1.92592994438723585305597794258492732E-34f128

Source§

const MIN: Self = -1.18973149535723176508575932662800702E+4932f128

Source§

const MIN_POSITIVE: Self = 3.3621031431120935062626778173217526E-4932f128

Source§

const MAX: Self = 1.18973149535723176508575932662800702E+4932f128

Source§

const ZERO: Self = 0f128

Source§

const ONE: Self = 1f128

Source§

const INFINITY: Self = +Inf_f128

Source§

const NEG_INFINITY: Self = -Inf_f128

Source§

const NAN: Self = NaN_f128

Source§

const EGAMMA: Self = 0.577215664901532860606512090082402471f128

Available on crate feature nightly_backports only.
Source§

const PHI: Self = 1.61803398874989484820458683436563816f128

Available on crate feature nightly_backports only.
Source§

const E: Self = 2.71828182845904523536028747135266231f128

Source§

const PI: Self = 3.1415926535897932384626433832795028f128

Source§

const TAU: Self = 6.28318530717958647692528676655900559f128

Source§

const LOG2_10: Self = 3.32192809488736234787031942948939029f128

Source§

const LOG2_E: Self = 1.44269504088896340735992468100189204f128

Source§

const LN_2: Self = 0.693147180559945309417232121458176575f128

Source§

const LN_10: Self = 2.30258509299404568401799145468436418f128

Source§

const LOG10_2: Self = 0.30102999566398119521373889472449302f128

Source§

const LOG10_E: Self = 0.434294481903251827651128918916605096f128

Source§

const SQRT_2: Self = 1.41421356237309504880168872420969798f128

Source§

const SQRT_3: Self = 1.73205080756887729352744634150587232f128

Available on crate feature nightly_backports only.
Source§

const FRAC_1_PI: Self = 0.318309886183790671537767526745028737f128

Source§

const FRAC_1_SQRT_2: Self = 0.707106781186547524400844362104848992f128

Source§

const FRAC_1_SQRT_3: Self = 0.577350269189625764509148780501957409f128

Available on crate feature nightly_backports only.
Source§

const FRAC_1_SQRT_PI: Self = 0.564189583547756286948079451560772632f128

Available on crate feature nightly_backports only.
Source§

const FRAC_1_SQRT_2PI: Self = 0.398942280401432677939946059934381874f128

Available on crate feature nightly_backports only.
Source§

const FRAC_2_PI: Self = 0.636619772367581343075535053490057474f128

Source§

const FRAC_2_SQRT_PI: Self = 1.12837916709551257389615890312154526f128

Source§

const FRAC_PI_2: Self = 1.5707963267948966192313216916397514f128

Source§

const FRAC_PI_3: Self = 1.04719755119659774615421446109316766f128

Source§

const FRAC_PI_4: Self = 0.785398163397448309615660845819875699f128

Source§

const FRAC_PI_6: Self = 0.523598775598298873077107230546583832f128

Source§

const FRAC_PI_8: Self = 0.39269908169872415480783042290993785f128

Source§

type Bytes = [u8; 16]

Source§

type Bits = u128

Source§

fn from_f16(value: f16) -> Self

Available on crate feature f16 only.
Source§

fn from_f64_lossy(value: f64) -> Self

Source§

fn from_f128_lossy(value: f128) -> Self

Source§

fn from_ne_bytes(bytes: Self::Bytes) -> Self

Source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

Source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

Source§

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

Source§

fn abs(self) -> Self

Source§

fn recip(self) -> Self

Source§

fn midpoint(self, rhs: Self) -> Self

Source§

fn to_radians(self) -> Self

Source§

fn to_degrees(self) -> Self

Source§

fn next_down(self) -> Self

Source§

fn next_up(self) -> Self

Source§

fn signum(self) -> Self

Source§

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

Source§

fn algebraic_add(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_sub(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_mul(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_div(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn algebraic_rem(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn classify(self) -> FpCategory

Source§

fn is_nan(self) -> bool

Source§

fn is_infinite(self) -> bool

Source§

fn is_finite(self) -> bool

Source§

fn is_normal(self) -> bool

Source§

fn is_subnormal(self) -> bool

Source§

fn is_sign_negative(self) -> bool

Source§

fn is_sign_positive(self) -> bool

Source§

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

Source§

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

Source§

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

Source§

fn minimum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

fn maximum(self, rhs: Self) -> Self

Available on crate feature nightly_backports only.
Source§

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

Source§

unsafe fn to_int_unchecked<T>(self) -> T
where Self: FloatToInt<T>,

Source§

fn to_ne_bytes(self) -> Self::Bytes

Source§

fn to_le_bytes(self) -> Self::Bytes

Source§

fn to_be_bytes(self) -> Self::Bytes

Source§

fn to_bits(self) -> Self::Bits

Implementors§