Struct rustduino::math::F32 [−][src]
pub struct F32(pub f32);
Expand description
32-bit floating point wrapper which implements fast approximation-based operations.
Implementations
Calculates Euclidean division, the matching method for rem_euclid
.
Calculates the least non-negative remainder of self (mod rhs)
.
Number of significant digits in base 2.
Machine epsilon value for f32
.
This is the difference between 1.0
and the next larger representable number.
Smallest positive normal f32
value.
Minimum possible normal power of 10 exponent.
Maximum possible power of 10 exponent.
Negative infinity (−∞).
Returns true
if this value is positive infinity or negative infinity, and
false
otherwise.
Returns true
if self
has a positive sign, including +0.0
, NaN
s with
positive sign bit and positive infinity.
Returns true
if self
has a negative sign, including -0.0
, NaN
s with
negative sign bit and negative infinity.
Raw transmutation to u32
.
This is currently identical to transmute::<f32, u32>(self)
on all platforms.
See F32::from_bits
for some discussion of the portability of this operation
(there are almost no issues).
Raw transmutation from u32
.
This is currently identical to transmute::<u32, f32>(v)
on all platforms.
It turns out this is incredibly portable, for two reasons:
- Floats and Ints have the same endianness on all supported platforms.
- IEEE-754 very precisely specifies the bit layout of floats.
See f32::from_bits
for more information.
Trait Implementations
Performs the +=
operation. Read more
Performs the +=
operation. Read more
Performs the /=
operation. Read more
Performs the /=
operation. Read more
type Err = ParseFloatError
type Err = ParseFloatError
The associated error which can be returned from parsing.
Performs the *=
operation. Read more
Performs the *=
operation. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Performs the %=
operation. Read more
Performs the %=
operation. Read more
Performs the -=
operation. Read more
Performs the -=
operation. Read more