Struct micromath::F32 [−][src]
pub struct F32(pub f32);
32-bit floating point wrapper which implements fast approximation-based operations.
Implementations
impl F32
[src]
impl F32
[src]pub fn div_euclid(self, rhs: Self) -> Self
[src]
Calculates Euclidean division, the matching method for rem_euclid
.
impl F32
[src]
impl F32
[src]pub fn rem_euclid(self, rhs: Self) -> Self
[src]
Calculates the least non-negative remainder of self (mod rhs)
.
impl F32
[src]
impl F32
[src]pub const ZERO: Self
[src]
The value 0.0
.
pub const ONE: Self
[src]
The value 1.0
.
pub const RADIX: u32
[src]
The radix or base of the internal representation of f32
.
pub const MANTISSA_DIGITS: u32
[src]
Number of significant digits in base 2.
pub const DIGITS: u32
[src]
Approximate number of significant digits in base 10.
pub const EPSILON: Self
[src]
Machine epsilon value for f32
.
This is the difference between 1.0
and the next larger representable number.
pub const MIN: Self
[src]
Smallest finite f32
value.
pub const MIN_POSITIVE: Self
[src]
Smallest positive normal f32
value.
pub const MAX: Self
[src]
Largest finite f32
value.
pub const MIN_EXP: i32
[src]
One greater than the minimum possible normal power of 2 exponent.
pub const MAX_EXP: i32
[src]
Maximum possible power of 2 exponent.
pub const MIN_10_EXP: i32
[src]
Minimum possible normal power of 10 exponent.
pub const MAX_10_EXP: i32
[src]
Maximum possible power of 10 exponent.
pub const NAN: Self
[src]
Not a Number (NaN).
pub const INFINITY: Self
[src]
Infinity (∞).
pub const NEG_INFINITY: Self
[src]
Negative infinity (−∞).
pub fn is_nan(self) -> bool
[src]
Returns true
if this value is NaN
.
pub fn is_infinite(self) -> bool
[src]
Returns true
if this value is positive infinity or negative infinity, and
false
otherwise.
pub fn is_finite(self) -> bool
[src]
Returns true
if this number is neither infinite nor NaN
.
pub fn is_sign_positive(self) -> bool
[src]
Returns true
if self
has a positive sign, including +0.0
, NaN
s with
positive sign bit and positive infinity.
pub fn is_sign_negative(self) -> bool
[src]
Returns true
if self
has a negative sign, including -0.0
, NaN
s with
negative sign bit and negative infinity.
pub fn to_bits(self) -> u32
[src]
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).
pub fn from_bits(v: u32) -> Self
[src]
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
impl AddAssign<f32> for F32
[src]
impl AddAssign<f32> for F32
[src]fn add_assign(&mut self, rhs: f32)
[src]
impl Clone for F32
[src]
impl Clone for F32
[src]fn clone(&self) -> F32
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl DivAssign<f32> for F32
[src]
impl DivAssign<f32> for F32
[src]fn div_assign(&mut self, rhs: f32)
[src]
impl FromStr for F32
[src]
impl FromStr for F32
[src]type Err = ParseFloatError
The associated error which can be returned from parsing.
fn from_str(src: &str) -> Result<F32, ParseFloatError>
[src]
impl MulAssign<f32> for F32
[src]
impl MulAssign<f32> for F32
[src]fn mul_assign(&mut self, rhs: f32)
[src]
impl Num for F32
[src]
impl Num for F32
[src]num-traits
only.type FromStrRadixErr = ParseFloatError
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
[src]
impl PartialOrd<F32> for F32
[src]
impl PartialOrd<F32> for F32
[src]impl PartialOrd<f32> for F32
[src]
impl PartialOrd<f32> for F32
[src]impl RemAssign<f32> for F32
[src]
impl RemAssign<f32> for F32
[src]fn rem_assign(&mut self, rhs: f32)
[src]
impl StructuralPartialEq for F32
[src]
impl StructuralPartialEq for F32
[src]impl SubAssign<f32> for F32
[src]
impl SubAssign<f32> for F32
[src]fn sub_assign(&mut self, rhs: f32)
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> NumAssign for T where
T: Num + NumAssignOps<T>,
[src]
impl<T> NumAssign for T where
T: Num + NumAssignOps<T>,
[src]impl<T, Rhs> NumAssignOps<Rhs> for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
[src]
impl<T, Rhs> NumAssignOps<Rhs> for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
[src]impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]