PrimitiveFloat

Trait PrimitiveFloat 

Source
pub trait PrimitiveFloat:
    PrimitiveNumber
    + From<i8>
    + From<u8>
    + Neg<Output = Self> {
    type Bits: PrimitiveUnsigned;
Show 33 associated constants and 58 methods const DIGITS: u32; const EPSILON: Self; const INFINITY: Self; const MANTISSA_DIGITS: u32; const MAX: Self; const MAX_10_EXP: i32; const MAX_EXP: i32; const MIN: Self; const MIN_10_EXP: i32; const MIN_EXP: i32; const MIN_POSITIVE: Self; const NAN: Self; const NEG_INFINITY: Self; const RADIX: u32; const E: Self; const FRAC_1_PI: Self; const FRAC_1_SQRT_2: 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 LN_2: Self; const LN_10: Self; const LOG2_10: Self; const LOG2_E: Self; const LOG10_2: Self; const LOG10_E: Self; const PI: Self; const SQRT_2: Self; const TAU: Self; // Required methods fn abs(self) -> Self; fn clamp(self, min: Self, max: Self) -> Self; fn classify(self) -> FpCategory; fn copysign(self, sign: Self) -> Self; fn from_bits(value: Self::Bits) -> Self; fn is_finite(self) -> bool; fn is_infinite(self) -> bool; fn is_nan(self) -> bool; fn is_normal(self) -> bool; fn is_sign_negative(self) -> bool; fn is_sign_positive(self) -> bool; fn is_subnormal(self) -> bool; fn max(self, other: Self) -> Self; fn midpoint(self, other: Self) -> Self; fn min(self, other: Self) -> Self; fn recip(self) -> Self; fn signum(self) -> Self; fn to_bits(self) -> Self::Bits; fn to_degrees(self) -> Self; fn to_radians(self) -> Self; fn total_cmp(&self, other: &Self) -> Ordering; unsafe fn to_int_unchecked<Int>(self) -> Int where Self: PrimitiveFloatToInt<Int>; fn acos(self) -> Self; fn acosh(self) -> Self; fn asin(self) -> Self; fn asinh(self) -> Self; fn atan(self) -> Self; fn atan2(self, other: Self) -> Self; fn atanh(self) -> Self; fn cbrt(self) -> Self; fn ceil(self) -> Self; fn cos(self) -> Self; fn cosh(self) -> Self; fn div_euclid(self, rhs: Self) -> Self; fn exp(self) -> Self; fn exp2(self) -> Self; fn exp_m1(self) -> Self; fn floor(self) -> Self; fn fract(self) -> Self; fn hypot(self, other: Self) -> Self; fn ln(self) -> Self; fn ln_1p(self) -> Self; fn log(self, base: Self) -> Self; fn log2(self) -> Self; fn log10(self) -> Self; fn mul_add(self, a: Self, b: Self) -> Self; fn powf(self, n: Self) -> Self; fn powi(self, n: i32) -> Self; fn rem_euclid(self, rhs: Self) -> Self; fn round(self) -> Self; fn round_ties_even(self) -> Self; fn sin(self) -> Self; fn sin_cos(self) -> (Self, Self); fn sinh(self) -> Self; fn sqrt(self) -> Self; fn tan(self) -> Self; fn tanh(self) -> Self; fn trunc(self) -> Self;
}
Expand description

Trait for all primitive floating-point types, including the supertrait PrimitiveNumber.

This encapsulates trait implementations, constants, and inherent methods that are common among the primitive floating-point types, f32 and f64. Unstable types f16 and f128 will be added once they are stabilized.

See the corresponding items on the individual types for more documentation and examples.

This trait is sealed with a private trait to prevent downstream implementations, so we may continue to expand along with the standard library without worrying about breaking changes for implementors.

§Examples

This example requires the std feature for powi and sqrt:

use num_primitive::PrimitiveFloat;

// Euclidean distance, √(∑(aᵢ - bᵢ)²)
fn distance<T: PrimitiveFloat>(a: &[T], b: &[T]) -> T {
    assert_eq!(a.len(), b.len());
    core::iter::zip(a, b).map(|(a, b)| (*a - b).powi(2)).sum::<T>().sqrt()
}

assert_eq!(distance::<f32>(&[0., 0.], &[3., 4.]), 5.);
assert_eq!(distance::<f64>(&[0., 1., 2.], &[1., 3., 0.]), 3.);

This example works without any features:

use num_primitive::PrimitiveFloat;

// Squared Euclidean distance, ∑(aᵢ - bᵢ)²
fn distance_squared<T: PrimitiveFloat>(a: &[T], b: &[T]) -> T {
    assert_eq!(a.len(), b.len());
    core::iter::zip(a, b).map(|(a, b)| (*a - b)).map(|x| x * x).sum::<T>()
}

assert_eq!(distance_squared::<f32>(&[0., 0.], &[3., 4.]), 25.);
assert_eq!(distance_squared::<f64>(&[0., 1., 2.], &[1., 3., 0.]), 9.);

Required Associated Constants§

Source

const DIGITS: u32

Approximate number of significant digits in base 10.

Source

const EPSILON: Self

Machine epsilon value.

Source

const INFINITY: Self

Infinity (∞).

Source

const MANTISSA_DIGITS: u32

Number of significant digits in base 2.

Source

const MAX: Self

Largest finite value.

Source

const MAX_10_EXP: i32

Maximum x for which 10x is normal.

Source

const MAX_EXP: i32

Maximum possible power of 2 exponent.

Source

const MIN: Self

Smallest finite value.

Source

const MIN_10_EXP: i32

Minimum x for which 10x is normal.

Source

const MIN_EXP: i32

One greater than the minimum possible normal power of 2 exponent.

Source

const MIN_POSITIVE: Self

Smallest positive normal value.

Source

const NAN: Self

Not a Number (NaN).

Source

const NEG_INFINITY: Self

Negative infinity (−∞).

Source

const RADIX: u32

The radix or base of the internal representation.

Source

const E: Self

Euler’s number (e)

Source

const FRAC_1_PI: Self

1/π

Source

const FRAC_1_SQRT_2: Self

1/sqrt(2)

Source

const FRAC_2_PI: Self

2/π

Source

const FRAC_2_SQRT_PI: Self

2/sqrt(π)

Source

const FRAC_PI_2: Self

π/2

Source

const FRAC_PI_3: Self

π/3

Source

const FRAC_PI_4: Self

π/4

Source

const FRAC_PI_6: Self

π/6

Source

const FRAC_PI_8: Self

π/8

Source

const LN_2: Self

ln(2)

Source

const LN_10: Self

ln(10)

Source

const LOG2_10: Self

log₂(10)

Source

const LOG2_E: Self

log₂(e)

Source

const LOG10_2: Self

log₁₀(2)

Source

const LOG10_E: Self

log₁₀(e)

Source

const PI: Self

Archimedes’ constant (π)

Source

const SQRT_2: Self

sqrt(2)

Source

const TAU: Self

The full circle constant (τ)

Required Associated Types§

Source

type Bits: PrimitiveUnsigned

An unsigned integer type used by methods from_bits and to_bits.

Required Methods§

Source

fn abs(self) -> Self

Computes the absolute value of self.

Source

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

Restrict a value to a certain interval unless it is NaN.

Source

fn classify(self) -> FpCategory

Returns the floating point category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead.

Source

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

Returns a number composed of the magnitude of self and the sign of sign.

Source

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

Raw transmutation from Self::Bits.

Source

fn is_finite(self) -> bool

Returns true if this number is neither infinite nor NaN.

Source

fn is_infinite(self) -> bool

Returns true if this value is positive infinity or negative infinity.

Source

fn is_nan(self) -> bool

Returns true if this value is NaN.

Source

fn is_normal(self) -> bool

Returns true if the number is neither zero, infinite, subnormal, or NaN.

Source

fn is_sign_negative(self) -> bool

Returns true if self has a negative sign, including -0.0, NaNs with negative sign bit and negative infinity.

Source

fn is_sign_positive(self) -> bool

Returns true if self has a positive sign, including +0.0, NaNs with positive sign bit and positive infinity.

Source

fn is_subnormal(self) -> bool

Returns true if the number is subnormal.

Source

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

Returns the maximum of the two numbers, ignoring NaN.

Source

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

Calculates the middle point of self and other.

Source

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

Returns the minimum of the two numbers, ignoring NaN.

Source

fn recip(self) -> Self

Takes the reciprocal (inverse) of a number, 1/x.

Source

fn signum(self) -> Self

Returns a number that represents the sign of self.

Source

fn to_bits(self) -> Self::Bits

Raw transmutation to Self::Bits.

Source

fn to_degrees(self) -> Self

Converts radians to degrees.

Source

fn to_radians(self) -> Self

Converts degrees to radians.

Source

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

Returns the ordering between self and other.

Source

unsafe fn to_int_unchecked<Int>(self) -> Int
where Self: PrimitiveFloatToInt<Int>,

Rounds toward zero and converts to any primitive integer type, assuming that the value is finite and fits in that type.

§Safety

The value must:

  • Not be NaN
  • Not be infinite
  • Be representable in the return type Int, after truncating off its fractional part
Source

fn acos(self) -> Self

Available on crate feature std only.

Computes the arccosine of a number. Return value is in radians in the range [0, pi] or NaN if the number is outside the range [-1, 1].

Source

fn acosh(self) -> Self

Available on crate feature std only.

Inverse hyperbolic cosine function.

Source

fn asin(self) -> Self

Available on crate feature std only.

Computes the arcsine of a number. Return value is in radians in the range [-pi/2, pi/2] or NaN if the number is outside the range [-1, 1].

Source

fn asinh(self) -> Self

Available on crate feature std only.

Inverse hyperbolic sine function.

Source

fn atan(self) -> Self

Available on crate feature std only.

Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2];

Source

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

Available on crate feature std only.

Computes the four quadrant arctangent of self (y) and other (x) in radians.

Source

fn atanh(self) -> Self

Available on crate feature std only.

Inverse hyperbolic tangent function.

Source

fn cbrt(self) -> Self

Available on crate feature std only.

Returns the cube root of a number.

Source

fn ceil(self) -> Self

Available on crate feature std only.

Returns the smallest integer greater than or equal to self.

Source

fn cos(self) -> Self

Available on crate feature std only.

Computes the cosine of a number (in radians).

Source

fn cosh(self) -> Self

Available on crate feature std only.

Hyperbolic cosine function.

Source

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

Available on crate feature std only.

Calculates Euclidean division, the matching method for rem_euclid.

Source

fn exp(self) -> Self

Available on crate feature std only.

Returns e^(self), (the exponential function).

Source

fn exp2(self) -> Self

Available on crate feature std only.

Returns 2^(self).

Source

fn exp_m1(self) -> Self

Available on crate feature std only.

Returns e^(self) - 1 in a way that is accurate even if the number is close to zero.

Source

fn floor(self) -> Self

Available on crate feature std only.

Returns the largest integer less than or equal to self.

Source

fn fract(self) -> Self

Available on crate feature std only.

Returns the fractional part of self.

Source

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

Available on crate feature std only.

Compute the distance between the origin and a point (x, y) on the Euclidean plane. Equivalently, compute the length of the hypotenuse of a right-angle triangle with other sides having length x.abs() and y.abs().

Source

fn ln(self) -> Self

Available on crate feature std only.

Returns the natural logarithm of the number.

Source

fn ln_1p(self) -> Self

Available on crate feature std only.

Returns ln(1+n) (natural logarithm) more accurately than if the operations were performed separately.

Source

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

Available on crate feature std only.

Returns the logarithm of the number with respect to an arbitrary base.

Source

fn log2(self) -> Self

Available on crate feature std only.

Returns the base 2 logarithm of the number.

Source

fn log10(self) -> Self

Available on crate feature std only.

Returns the base 10 logarithm of the number.

Source

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

Available on crate feature std only.

Fused multiply-add. Computes (self * a) + b with only one rounding error, yielding a more accurate result than an unfused multiply-add.

Source

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

Available on crate feature std only.

Raises a number to a floating point power.

Source

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

Available on crate feature std only.

Raises a number to an integer power.

Source

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

Available on crate feature std only.

Calculates the least nonnegative remainder of self (mod rhs).

Source

fn round(self) -> Self

Available on crate feature std only.

Returns the nearest integer to self. If a value is half-way between two integers, round away from 0.0.

Source

fn round_ties_even(self) -> Self

Available on crate feature std only.

Returns the nearest integer to a number. Rounds half-way cases to the number with an even least significant digit.

Source

fn sin(self) -> Self

Available on crate feature std only.

Computes the sine of a number (in radians).

Source

fn sin_cos(self) -> (Self, Self)

Available on crate feature std only.

Simultaneously computes the sine and cosine of the number, x. Returns (sin(x), cos(x)).

Source

fn sinh(self) -> Self

Available on crate feature std only.

Hyperbolic sine function.

Source

fn sqrt(self) -> Self

Available on crate feature std only.

Returns the square root of a number.

Source

fn tan(self) -> Self

Available on crate feature std only.

Computes the tangent of a number (in radians).

Source

fn tanh(self) -> Self

Available on crate feature std only.

Hyperbolic tangent function.

Source

fn trunc(self) -> Self

Available on crate feature std only.

Returns the integer part of self. This means that non-integer numbers are always truncated towards zero.

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

Source§

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

See the inherent from_bits method.

Source§

fn abs(self) -> Self

See the inherent abs method.

Source§

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

See the inherent clamp method.

Source§

fn classify(self) -> FpCategory

See the inherent classify method.

Source§

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

See the inherent copysign method.

Source§

fn is_finite(self) -> bool

See the inherent is_finite method.

Source§

fn is_infinite(self) -> bool

See the inherent is_infinite method.

Source§

fn is_nan(self) -> bool

See the inherent is_nan method.

Source§

fn is_normal(self) -> bool

See the inherent is_normal method.

Source§

fn is_sign_negative(self) -> bool

See the inherent is_sign_negative method.

Source§

fn is_sign_positive(self) -> bool

See the inherent is_sign_positive method.

Source§

fn is_subnormal(self) -> bool

See the inherent is_subnormal method.

Source§

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

See the inherent max method.

Source§

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

See the inherent midpoint method.

Source§

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

See the inherent min method.

Source§

fn recip(self) -> Self

See the inherent recip method.

Source§

fn signum(self) -> Self

See the inherent signum method.

Source§

fn to_bits(self) -> Self::Bits

See the inherent to_bits method.

Source§

fn to_degrees(self) -> Self

See the inherent to_degrees method.

Source§

fn to_radians(self) -> Self

See the inherent to_radians method.

Source§

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

See the inherent total_cmp method.

Source§

unsafe fn to_int_unchecked<Int>(self) -> Int
where Self: PrimitiveFloatToInt<Int>,

See the inherent to_int_unchecked method.

Source§

fn acos(self) -> Self

Available on crate feature std only.

See the inherent acos method.

Source§

fn acosh(self) -> Self

Available on crate feature std only.

See the inherent acosh method.

Source§

fn asin(self) -> Self

Available on crate feature std only.

See the inherent asin method.

Source§

fn asinh(self) -> Self

Available on crate feature std only.

See the inherent asinh method.

Source§

fn atan(self) -> Self

Available on crate feature std only.

See the inherent atan method.

Source§

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

Available on crate feature std only.

See the inherent atan2 method.

Source§

fn atanh(self) -> Self

Available on crate feature std only.

See the inherent atanh method.

Source§

fn cbrt(self) -> Self

Available on crate feature std only.

See the inherent cbrt method.

Source§

fn ceil(self) -> Self

Available on crate feature std only.

See the inherent ceil method.

Source§

fn cos(self) -> Self

Available on crate feature std only.

See the inherent cos method.

Source§

fn cosh(self) -> Self

Available on crate feature std only.

See the inherent cosh method.

Source§

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

Available on crate feature std only.

See the inherent div_euclid method.

Source§

fn exp(self) -> Self

Available on crate feature std only.

See the inherent exp method.

Source§

fn exp2(self) -> Self

Available on crate feature std only.

See the inherent exp2 method.

Source§

fn exp_m1(self) -> Self

Available on crate feature std only.

See the inherent exp_m1 method.

Source§

fn floor(self) -> Self

Available on crate feature std only.

See the inherent floor method.

Source§

fn fract(self) -> Self

Available on crate feature std only.

See the inherent fract method.

Source§

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

Available on crate feature std only.

See the inherent hypot method.

Source§

fn ln(self) -> Self

Available on crate feature std only.

See the inherent ln method.

Source§

fn ln_1p(self) -> Self

Available on crate feature std only.

See the inherent ln_1p method.

Source§

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

Available on crate feature std only.

See the inherent log method.

Source§

fn log2(self) -> Self

Available on crate feature std only.

See the inherent log2 method.

Source§

fn log10(self) -> Self

Available on crate feature std only.

See the inherent log10 method.

Source§

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

Available on crate feature std only.

See the inherent mul_add method.

Source§

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

Available on crate feature std only.

See the inherent powf method.

Source§

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

Available on crate feature std only.

See the inherent powi method.

Source§

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

Available on crate feature std only.

See the inherent rem_euclid method.

Source§

fn round(self) -> Self

Available on crate feature std only.

See the inherent round method.

Source§

fn round_ties_even(self) -> Self

Available on crate feature std only.

See the inherent round_ties_even method.

Source§

fn sin(self) -> Self

Available on crate feature std only.

See the inherent sin method.

Source§

fn sin_cos(self) -> (Self, Self)

Available on crate feature std only.

See the inherent sin_cos method.

Source§

fn sinh(self) -> Self

Available on crate feature std only.

See the inherent sinh method.

Source§

fn sqrt(self) -> Self

Available on crate feature std only.

See the inherent sqrt method.

Source§

fn tan(self) -> Self

Available on crate feature std only.

See the inherent tan method.

Source§

fn tanh(self) -> Self

Available on crate feature std only.

See the inherent tanh method.

Source§

fn trunc(self) -> Self

Available on crate feature std only.

See the inherent trunc method.

Source§

const DIGITS: u32 = 6u32

Source§

const EPSILON: Self = 1.1920929E-7f32

Source§

const INFINITY: Self = +Inf_f32

Source§

const MANTISSA_DIGITS: u32 = 24u32

Source§

const MAX: Self = 3.40282347E+38f32

Source§

const MAX_10_EXP: i32 = 38i32

Source§

const MAX_EXP: i32 = 128i32

Source§

const MIN: Self = -3.40282347E+38f32

Source§

const MIN_10_EXP: i32 = -37i32

Source§

const MIN_EXP: i32 = -125i32

Source§

const MIN_POSITIVE: Self = 1.17549435E-38f32

Source§

const NAN: Self = NaN_f32

Source§

const NEG_INFINITY: Self = -Inf_f32

Source§

const RADIX: u32 = 2u32

Source§

const E: Self = 2.71828175f32

Source§

const FRAC_1_PI: Self = 0.318309873f32

Source§

const FRAC_1_SQRT_2: Self = 0.707106769f32

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§

const LN_2: Self = 0.693147182f32

Source§

const LN_10: Self = 2.30258512f32

Source§

const LOG2_10: Self = 3.32192802f32

Source§

const LOG2_E: Self = 1.44269502f32

Source§

const LOG10_2: Self = 0.30103001f32

Source§

const LOG10_E: Self = 0.434294492f32

Source§

const PI: Self = 3.14159274f32

Source§

const SQRT_2: Self = 1.41421354f32

Source§

const TAU: Self = 6.28318548f32

Source§

type Bits = u32

Source§

impl PrimitiveFloat for f64

Source§

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

See the inherent from_bits method.

Source§

fn abs(self) -> Self

See the inherent abs method.

Source§

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

See the inherent clamp method.

Source§

fn classify(self) -> FpCategory

See the inherent classify method.

Source§

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

See the inherent copysign method.

Source§

fn is_finite(self) -> bool

See the inherent is_finite method.

Source§

fn is_infinite(self) -> bool

See the inherent is_infinite method.

Source§

fn is_nan(self) -> bool

See the inherent is_nan method.

Source§

fn is_normal(self) -> bool

See the inherent is_normal method.

Source§

fn is_sign_negative(self) -> bool

See the inherent is_sign_negative method.

Source§

fn is_sign_positive(self) -> bool

See the inherent is_sign_positive method.

Source§

fn is_subnormal(self) -> bool

See the inherent is_subnormal method.

Source§

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

See the inherent max method.

Source§

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

See the inherent midpoint method.

Source§

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

See the inherent min method.

Source§

fn recip(self) -> Self

See the inherent recip method.

Source§

fn signum(self) -> Self

See the inherent signum method.

Source§

fn to_bits(self) -> Self::Bits

See the inherent to_bits method.

Source§

fn to_degrees(self) -> Self

See the inherent to_degrees method.

Source§

fn to_radians(self) -> Self

See the inherent to_radians method.

Source§

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

See the inherent total_cmp method.

Source§

unsafe fn to_int_unchecked<Int>(self) -> Int
where Self: PrimitiveFloatToInt<Int>,

See the inherent to_int_unchecked method.

Source§

fn acos(self) -> Self

Available on crate feature std only.

See the inherent acos method.

Source§

fn acosh(self) -> Self

Available on crate feature std only.

See the inherent acosh method.

Source§

fn asin(self) -> Self

Available on crate feature std only.

See the inherent asin method.

Source§

fn asinh(self) -> Self

Available on crate feature std only.

See the inherent asinh method.

Source§

fn atan(self) -> Self

Available on crate feature std only.

See the inherent atan method.

Source§

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

Available on crate feature std only.

See the inherent atan2 method.

Source§

fn atanh(self) -> Self

Available on crate feature std only.

See the inherent atanh method.

Source§

fn cbrt(self) -> Self

Available on crate feature std only.

See the inherent cbrt method.

Source§

fn ceil(self) -> Self

Available on crate feature std only.

See the inherent ceil method.

Source§

fn cos(self) -> Self

Available on crate feature std only.

See the inherent cos method.

Source§

fn cosh(self) -> Self

Available on crate feature std only.

See the inherent cosh method.

Source§

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

Available on crate feature std only.

See the inherent div_euclid method.

Source§

fn exp(self) -> Self

Available on crate feature std only.

See the inherent exp method.

Source§

fn exp2(self) -> Self

Available on crate feature std only.

See the inherent exp2 method.

Source§

fn exp_m1(self) -> Self

Available on crate feature std only.

See the inherent exp_m1 method.

Source§

fn floor(self) -> Self

Available on crate feature std only.

See the inherent floor method.

Source§

fn fract(self) -> Self

Available on crate feature std only.

See the inherent fract method.

Source§

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

Available on crate feature std only.

See the inherent hypot method.

Source§

fn ln(self) -> Self

Available on crate feature std only.

See the inherent ln method.

Source§

fn ln_1p(self) -> Self

Available on crate feature std only.

See the inherent ln_1p method.

Source§

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

Available on crate feature std only.

See the inherent log method.

Source§

fn log2(self) -> Self

Available on crate feature std only.

See the inherent log2 method.

Source§

fn log10(self) -> Self

Available on crate feature std only.

See the inherent log10 method.

Source§

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

Available on crate feature std only.

See the inherent mul_add method.

Source§

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

Available on crate feature std only.

See the inherent powf method.

Source§

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

Available on crate feature std only.

See the inherent powi method.

Source§

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

Available on crate feature std only.

See the inherent rem_euclid method.

Source§

fn round(self) -> Self

Available on crate feature std only.

See the inherent round method.

Source§

fn round_ties_even(self) -> Self

Available on crate feature std only.

See the inherent round_ties_even method.

Source§

fn sin(self) -> Self

Available on crate feature std only.

See the inherent sin method.

Source§

fn sin_cos(self) -> (Self, Self)

Available on crate feature std only.

See the inherent sin_cos method.

Source§

fn sinh(self) -> Self

Available on crate feature std only.

See the inherent sinh method.

Source§

fn sqrt(self) -> Self

Available on crate feature std only.

See the inherent sqrt method.

Source§

fn tan(self) -> Self

Available on crate feature std only.

See the inherent tan method.

Source§

fn tanh(self) -> Self

Available on crate feature std only.

See the inherent tanh method.

Source§

fn trunc(self) -> Self

Available on crate feature std only.

See the inherent trunc method.

Source§

const DIGITS: u32 = 15u32

Source§

const EPSILON: Self = 2.2204460492503131E-16f64

Source§

const INFINITY: Self = +Inf_f64

Source§

const MANTISSA_DIGITS: u32 = 53u32

Source§

const MAX: Self = 1.7976931348623157E+308f64

Source§

const MAX_10_EXP: i32 = 308i32

Source§

const MAX_EXP: i32 = 1_024i32

Source§

const MIN: Self = -1.7976931348623157E+308f64

Source§

const MIN_10_EXP: i32 = -307i32

Source§

const MIN_EXP: i32 = -1_021i32

Source§

const MIN_POSITIVE: Self = 2.2250738585072014E-308f64

Source§

const NAN: Self = NaN_f64

Source§

const NEG_INFINITY: Self = -Inf_f64

Source§

const RADIX: u32 = 2u32

Source§

const E: Self = 2.7182818284590451f64

Source§

const FRAC_1_PI: Self = 0.31830988618379069f64

Source§

const FRAC_1_SQRT_2: Self = 0.70710678118654757f64

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§

const LN_2: Self = 0.69314718055994529f64

Source§

const LN_10: Self = 2.3025850929940459f64

Source§

const LOG2_10: Self = 3.3219280948873622f64

Source§

const LOG2_E: Self = 1.4426950408889634f64

Source§

const LOG10_2: Self = 0.3010299956639812f64

Source§

const LOG10_E: Self = 0.43429448190325182f64

Source§

const PI: Self = 3.1415926535897931f64

Source§

const SQRT_2: Self = 1.4142135623730951f64

Source§

const TAU: Self = 6.2831853071795862f64

Source§

type Bits = u64

Implementors§