[−][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]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
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.
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[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.
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
impl Send for Float
impl Sync for Float
impl Unpin for Float
impl UnwindSafe for Float
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,