[−][src]Struct ron::value::Float
A wrapper for f64
, which guarantees that the inner value
is finite and thus implements Eq
, Hash
and Ord
.
Implementations
impl Float
[src]
pub fn new(v: f64) -> Self
[src]
Construct a new Float
.
pub fn get(self) -> f64
[src]
Returns the wrapped float.
Trait Implementations
impl Clone for Float
[src]
impl Copy for Float
[src]
impl Debug for Float
[src]
impl Eq for Float
[src]
Equality comparison
In order to be able to use Float
as a mapping key, NaN floating values
wrapped in Float
are equals to each other. It is not the case for
underlying f64
values itself.
impl Hash for Float
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Float
[src]
Ordering comparison
In order to be able to use Float
as a mapping key, NaN floating values
wrapped in Float
are equals to each other and are less then any other
floating value. It is not the case for underlying f64
values itself. See
the PartialEq
implementation.
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Float> for Float
[src]
Partial equality comparison
In order to be able to use Number
as a mapping key, NaN floating values
wrapped in Float
are equals to each other. It is not the case for
underlying f64
values itself.
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Float> for Float
[src]
Partial ordering comparison
In order to be able to use Number
as a mapping key, NaN floating values
wrapped in Number
are equals to each other and are less then any other
floating value. It is not the case for the underlying f64
values themselves.
use ron::value::Number; assert!(Number::new(std::f64::NAN) < Number::new(std::f64::NEG_INFINITY)); assert_eq!(Number::new(std::f64::NAN), Number::new(std::f64::NAN));
Auto Trait Implementations
impl RefUnwindSafe for Float
[src]
impl Send for Float
[src]
impl Sync for Float
[src]
impl Unpin for Float
[src]
impl UnwindSafe for Float
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,