Primitive type

core::num::f32

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

Methods

const BITSsource

const BITS: u32 = 32;

The width of f32 in bits.

const NANsource

const NAN: f32 = 0.0 / 0.0;

Not a number: C's 0.0f / 0.0f. Which NaN is not specified, as for f64::NAN.

const INFINITYsource

const INFINITY: f32 = 1.0 / 0.0;

Positive infinity.

const NEG_INFINITYsource

const NEG_INFINITY: f32 = -1.0 / 0.0;

Negative infinity.

const MAXsource

const MAX: f32 = 3.4028235e38;

The largest finite f32, (2 - 2^-23) * 2^127.

const MINsource

const MIN: f32 = -f32::MAX;

The smallest finite f32, -f32::MAX.

const MIN_POSITIVEsource

const MIN_POSITIVE: f32 = 1.1754944e-38;

The smallest positive normal f32, 2^-126.

const EPSILONsource

const EPSILON: f32 = 1.1920929e-7;

The difference between 1.0 and the next larger f32, 2^-23.

method to_bitssource

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

The IEEE 754 bits of self, as a u32.

method from_bitssource

fn from_bits(bits: u32) -> f32 { ... }

The f32 whose IEEE 754 bits are bits.

method to_f64source

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

self as an f64, exactly.

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, as f64::is_sign_negative.

method abssource

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

self without its sign bit.

method copysignsource

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

The magnitude of self with the sign of sign.

method truncsource

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

self rounded toward zero to an integral value, as f64::trunc.

method floorsource

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

The largest integral value not above self.

method ceilsource

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

The smallest integral value not below self.

method roundsource

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

The nearest integral value, halfway cases away from zero.

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.

Instances

instance Format[f32, W]source

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

In core::fmt.

An f32 formats as the shortest decimal that reads back as it (write_f32).

instance Printable[f32, W]source

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

In core::fmt.

An f32 prints as the shortest decimal that reads back as it (write_f32).