pub struct Float64(/* private fields */);Expand description
Finite canonical f64 atom.
Implementations§
Source§impl Float64
impl Float64
Sourcepub fn try_new(value: f64) -> Option<Self>
pub fn try_new(value: f64) -> Option<Self>
Construct a finite float and normalize negative zero.
Sourcepub const fn to_be_bytes(&self) -> [u8; 8]
pub const fn to_be_bytes(&self) -> [u8; 8]
Return the stable big-endian IEEE-754 representation.
Sourcepub fn try_from_bytes(bytes: &[u8]) -> Result<Self, Float64DecodeError>
pub fn try_from_bytes(bytes: &[u8]) -> Result<Self, Float64DecodeError>
Decode one stable big-endian IEEE-754 representation.
§Errors
Returns a typed error for the wrong byte length or a non-finite value.
Trait Implementations§
Source§impl CandidType for Float64
impl CandidType for Float64
impl Copy for Float64
Source§impl<'de> Deserialize<'de> for Float64
impl<'de> Deserialize<'de> for Float64
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
impl Eq for Float64
Source§impl NumericValue for Float64
impl NumericValue for Float64
Source§fn try_to_decimal(&self) -> Option<Decimal>
fn try_to_decimal(&self) -> Option<Decimal>
Convert this value into
Decimal for generic numeric handling.Source§fn try_from_decimal(value: Decimal) -> Option<Self>
fn try_from_decimal(value: Decimal) -> Option<Self>
Rebuild the value from
Decimal after generic numeric handling.Source§impl Ord for Float64
impl Ord for Float64
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Float64
impl PartialOrd for Float64
Auto Trait Implementations§
impl Freeze for Float64
impl RefUnwindSafe for Float64
impl Send for Float64
impl Sync for Float64
impl Unpin for Float64
impl UnsafeUnpin for Float64
impl UnwindSafe for Float64
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