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
Subtracts 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 AddAssign for FiniteF64
impl AddAssign for FiniteF64
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§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 IntoValue for FiniteF64
impl IntoValue for FiniteF64
Source§fn into_value(self) -> Value
fn into_value(self) -> Value
Boxes the meta structure back into a value.
Source§fn serialize_payload<S>(
&self,
s: S,
_behavior: SkipSerialization,
) -> Result<S::Ok, S::Error>where
Self: Sized,
S: Serializer,
fn serialize_payload<S>(
&self,
s: S,
_behavior: SkipSerialization,
) -> Result<S::Ok, S::Error>where
Self: Sized,
S: Serializer,
Efficiently serializes the payload directly.
Source§fn extract_child_meta(&self) -> MetaMapwhere
Self: Sized,
fn extract_child_meta(&self) -> MetaMapwhere
Self: Sized,
Extracts children meta map out of a value.
Source§impl Ord for FiniteF64
impl Ord for FiniteF64
Source§impl PartialOrd<f64> for FiniteF64
impl PartialOrd<f64> 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