pub struct FiniteF64(/* private fields */);
Expand description
A finite 64-bit floating point type.
This is a restricted version of f64
that does not allow NaN or infinity.
Implementations§
source§impl FiniteF64
impl FiniteF64
sourcepub const unsafe fn new_unchecked(value: f64) -> Self
pub const unsafe fn new_unchecked(value: f64) -> Self
Creates a finite float without checking whether the value is finte. This results in undefined behavior if the value is non-finite.
§Safety
The value must not be NaN or infinite.
sourcepub fn saturating_add(self, other: Self) -> Self
pub fn saturating_add(self, other: Self) -> Self
Adds two numbers, saturating at the maximum and minimum representable values.
sourcepub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
Adds two numbers, saturating at the maximum and minimum representable values.
sourcepub fn saturating_mul(self, other: Self) -> Self
pub fn saturating_mul(self, other: Self) -> Self
Multiplies two numbers, saturating at the maximum and minimum representable values.
sourcepub fn saturating_div(self, other: Self) -> Self
pub fn saturating_div(self, other: Self) -> Self
Divides two numbers, saturating at the maximum and minimum representable values.
Trait Implementations§
source§impl<'de> Deserialize<'de> for FiniteF64
impl<'de> Deserialize<'de> for FiniteF64
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for FiniteF64
impl Ord for FiniteF64
source§impl PartialOrd for FiniteF64
impl PartialOrd for FiniteF64
impl Copy for FiniteF64
impl Eq for FiniteF64
impl StructuralPartialEq for FiniteF64
Auto Trait Implementations§
impl Freeze for FiniteF64
impl RefUnwindSafe for FiniteF64
impl Send for FiniteF64
impl Sync for FiniteF64
impl Unpin for FiniteF64
impl UnwindSafe for FiniteF64
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more