pub struct F32(pub f32);
Expand description
A wrapper for f32
, which implements Eq
, Hash
and Ord
using f32::total_cmp
for a total order comparison
Tuple Fields§
§0: f32
Implementations§
Trait Implementations§
Source§impl Ord for F32
Ordering comparison
impl Ord for F32
Ordering comparison
In order to be able to use F32
as a mapping key, floating values use f32::total_cmp
for a total order comparison.
use ron::value::F32;
assert!(F32::new(f32::NAN) > F32::new(f32::INFINITY));
assert!(F32::new(-f32::NAN) < F32::new(f32::NEG_INFINITY));
assert!(F32::new(f32::NAN) == F32::new(f32::NAN));
Source§impl PartialEq for F32
Partial equality comparison
impl PartialEq for F32
Partial equality comparison
In order to be able to use F32
as a mapping key, floating values use f32::total_cmp
for a total order comparison.
See the Ord
implementation.
Source§impl PartialOrd for F32
Partial ordering comparison
impl PartialOrd for F32
Partial ordering comparison
In order to be able to use F32
as a mapping key, floating values use f32::total_cmp
for a total order comparison.
See the Ord
implementation.
impl Copy for F32
impl Eq for F32
Equality comparison
In order to be able to use F32
as a mapping key, floating values use f32::total_cmp
for a total order comparison.
See the Ord
implementation.
Auto Trait Implementations§
impl Freeze for F32
impl RefUnwindSafe for F32
impl Send for F32
impl Sync for F32
impl Unpin for F32
impl UnwindSafe for F32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more