Primitive type

core::num::f64

The methods of f64 that core::num defines, and the instances that mention it.

Methods

const BITSsource

const BITS: u32 = 64;

The width of f64 in bits.

const NANsource

const NAN: f64 = 0.0 / 0.0;

Not a number: C's 0.0 / 0.0. Which NaN, its sign and payload, is not specified; test for one with is_nan, since a NaN equals nothing.

const INFINITYsource

const INFINITY: f64 = 1.0 / 0.0;

Positive infinity.

const NEG_INFINITYsource

const NEG_INFINITY: f64 = -1.0 / 0.0;

Negative infinity.

const MAXsource

const MAX: f64 = 1.7976931348623157e308;

The largest finite f64, (2 - 2^-52) * 2^1023.

const MINsource

const MIN: f64 = -f64::MAX;

The smallest finite f64, -f64::MAX.

const MIN_POSITIVEsource

const MIN_POSITIVE: f64 = 2.2250738585072014e-308;

The smallest positive normal f64, 2^-1022.

const EPSILONsource

const EPSILON: f64 = 2.220446049250313e-16;

The difference between 1.0 and the next larger f64, 2^-52.

method to_bitssource

fn to_bits(self) -> u64 { ... }

The IEEE 754 bits of self, as a u64.

method from_bitssource

fn from_bits(bits: u64) -> f64 { ... }

The f64 whose IEEE 754 bits are bits.

method to_f32source

fn to_f32(self) -> f32 { ... }

self rounded to the nearest f32, ties to even, and past the largest to an infinity.

method is_nansource

fn is_nan(self) -> bool { ... }

Whether self is a NaN.

method is_infinitesource

fn is_infinite(self) -> bool { ... }

Whether self is positive or negative infinity.

method is_finitesource

fn is_finite(self) -> bool { ... }

Whether self is neither infinite nor a NaN.

method is_sign_negativesource

fn is_sign_negative(self) -> bool { ... }

Whether the sign bit of self is set: for a negative number, for -0.0, and for a NaN with the bit set.

method abssource

fn abs(self) -> f64 { ... }

self without its sign bit.

method copysignsource

fn copysign(self, sign: f64) -> f64 { ... }

The magnitude of self with the sign of sign.

method truncsource

fn trunc(self) -> f64 { ... }

self rounded toward zero to an integral value, keeping its sign (-0.5f64.trunc() is -0.0). An infinity and a NaN stay as they are.

method floorsource

fn floor(self) -> f64 { ... }

The largest integral value not above self.

method ceilsource

fn ceil(self) -> f64 { ... }

The smallest integral value not below self.

method roundsource

fn round(self) -> f64 { ... }

The nearest integral value, halfway cases away from zero, as C's round.

method to_i64_checkedsource

fn to_i64_checked(self) -> Option[i64] { ... }

self toward zero as an i64, or nothing when that is out of i64's range or self is a NaN, where as saturates or gives 0.

Instances

instance Format[f64, W]source

forall W where Writer[W].
instance Format[f64, W] { ... }

In core::fmt.

An f64 formats as the shortest decimal that reads back as it (write_f64).

instance Printable[f64, W]source

forall W where Writer[W].
instance Printable[f64, W] { ... }

In core::fmt.

An f64 prints as the shortest decimal that reads back as it (write_f64).