pub struct DecFloat128(pub Bitstring128);Available on crate feature
decstr only.Expand description
A 128-bit ieee-754 quadruple-precision decimal floating-point (w) number, from the set $\R$,
also known as Df128.
The range of valid numeric values is $\lbrack$MIN $\dots$ MAX$\rbrack$.
Supports 34 decimal digits of significand and a normalized exponent range of −6176 to +6111.
It doesn’t implement any arithmetic operations and is mainly intended for storage and interchange.
Tuple Fields§
§0: Bitstring128Implementations§
Source§impl DecFloat128
§Constructors
impl DecFloat128
§Constructors
Sourcepub const fn new(value: Bitstring128) -> Self
pub const fn new(value: Bitstring128) -> Self
Returns a new DecFloat128.
Trait Implementations§
Source§impl Bound for DecFloat128
impl Bound for DecFloat128
Source§fn is_lower_bounded(&self) -> bool
fn is_lower_bounded(&self) -> bool
Returns true if the number is lower bounded.
Source§fn is_upper_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
Returns true if the number is upper bounded.
Source§fn lower_bound(&self) -> Option<Self>
fn lower_bound(&self) -> Option<Self>
Returns the lower bound, if any.
Source§fn upper_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Returns the upper bound, if any.
Source§impl Clone for DecFloat128
impl Clone for DecFloat128
Source§fn clone(&self) -> DecFloat128
fn clone(&self) -> DecFloat128
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConstLowerBounded for DecFloat128
impl ConstLowerBounded for DecFloat128
Source§impl ConstNegOne for DecFloat128
impl ConstNegOne for DecFloat128
Source§impl ConstUpperBounded for DecFloat128
impl ConstUpperBounded for DecFloat128
Source§impl Count for DecFloat128
impl Count for DecFloat128
Source§fn is_countable(&self) -> bool
fn is_countable(&self) -> bool
Returns
true if the number is countable.Source§fn is_uncountable(&self) -> bool
fn is_uncountable(&self) -> bool
Returns
false if the number is countable.Source§impl Debug for DecFloat128
impl Debug for DecFloat128
Source§impl Default for DecFloat128
impl Default for DecFloat128
Source§impl Display for DecFloat128
impl Display for DecFloat128
Source§impl Ident for DecFloat128
impl Ident for DecFloat128
Source§fn can_neg_one(&self) -> bool
fn can_neg_one(&self) -> bool
Returns
true if the number can represent -1,
the additive inverse of the multiplicative identity. Read moreSource§fn is_neg_one(&self) -> bool
fn is_neg_one(&self) -> bool
Returns
true if the current value is -1,
the additive inverse of the multiplicative identity.Source§impl LowerBounded for DecFloat128
impl LowerBounded for DecFloat128
Source§impl NegOne for DecFloat128
impl NegOne for DecFloat128
Source§fn new_neg_one() -> Self
fn new_neg_one() -> Self
Returns a new additive inverse of the multiplicative identity,
-1.Source§fn set_neg_one(&mut self)where
Self: Sized,
fn set_neg_one(&mut self)where
Self: Sized,
Sets this number to
-1.Source§impl Number for DecFloat128
impl Number for DecFloat128
Source§fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>
fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>
Source§unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self
Available on crate feature not(safe) only.
unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self
not(safe) only.Source§fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>
fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>
Source§unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self
Available on crate feature not(safe) only.
unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self
not(safe) only.Source§type InnerRepr = Bitstring128
type InnerRepr = Bitstring128
The inner primitive representation of the number. Read more
Source§type InnermostRepr = Bitstring128
type InnermostRepr = Bitstring128
The innermost primitive representation of the number. Read more
Source§fn into_inner_repr(self) -> Self::InnerRepr
fn into_inner_repr(self) -> Self::InnerRepr
Deconstructs the number to its inner representation.
Source§fn into_innermost_repr(self) -> Self::InnermostRepr
fn into_innermost_repr(self) -> Self::InnermostRepr
Deconstructs the number to its innermost representation.
Source§fn try_from_inner_repr(inner: impl Into<Self::InnerRepr>) -> NumeraResult<Self>where
Self: Sized,
fn try_from_inner_repr(inner: impl Into<Self::InnerRepr>) -> NumeraResult<Self>where
Self: Sized,
Forms a new number from its converted given
inner representation. Read moreSource§impl One for DecFloat128
impl One for DecFloat128
Source§impl PartialEq for DecFloat128
impl PartialEq for DecFloat128
Source§impl PartialOrd for DecFloat128
impl PartialOrd for DecFloat128
Source§impl Sign for DecFloat128
impl Sign for DecFloat128
Source§fn can_negative(&self) -> bool
fn can_negative(&self) -> bool
Returns
true if the type can represent negative numbers.Source§fn can_positive(&self) -> bool
fn can_positive(&self) -> bool
Returns
true if the type can represent positive numbers.Source§fn is_negative(&self) -> bool
fn is_negative(&self) -> bool
Returns
true if the value is negative (< 0).Source§fn is_positive(&self) -> bool
fn is_positive(&self) -> bool
Returns
true if the value is positive (> 0).Source§impl UpperBounded for DecFloat128
impl UpperBounded for DecFloat128
Source§impl Zero for DecFloat128
impl Zero for DecFloat128
impl Copy for DecFloat128
impl Negative for DecFloat128
impl Positive for DecFloat128
impl Uncountable for DecFloat128
Auto Trait Implementations§
impl Freeze for DecFloat128
impl RefUnwindSafe for DecFloat128
impl Send for DecFloat128
impl Sync for DecFloat128
impl Unpin for DecFloat128
impl UnwindSafe for DecFloat128
Blanket Implementations§
Source§impl<T> Also for T
impl<T> Also for T
Source§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.