#[repr(transparent)]
pub struct Decimal<const P: u8> where
PrecLimitCheck<{ P <= MAX_PREC }>: True, { /* fields omitted */ }
Expand description
Represents a decimal number as a coefficient (stored as an i128 value)
combined with a type parameter specifying the number of fractional decimal
digits.
The type parameter P can be in the range 0 .. MAX_PREC.
impl<const P: u8> Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Returns true if self is equal to zero.
Returns true if self is equal to one.
Returns true if self is less than zero.
Returns true if self is greater than zero.
impl<const P: u8> Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Returns the multiplicative identity element of Self, Self::ONE.
Returns true if self is equal to the multiplicative identity.
impl<const P: u8> Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Returns the absolute value of self.
Returns the largest integral value <= self.
Panics with ‘attempt to multiply with overflow’ when called on a value
less than
(Decimal::<P>::MIN / 10 ^ P) * 10 ^ P !
let d = Dec!(17.5);
assert_eq!(d.floor().to_string(), "17.0");
let d = Dec!(-17.050);
assert_eq!(d.floor().to_string(), "-18.000");
Returns the smallest integral value >= self.
Panics with ‘attempt to multiply with overflow’ when called on a value
greater than
(Decimal::<P>::MAX / 10 ^ P) * 10 ^ P !
let d = Dec!(17.5);
assert_eq!(d.ceil().to_string(), "18.0");
let d = Dec!(-17.50);
assert_eq!(d.ceil().to_string(), "-17.00");
Returns the integral part of self.
let d = Dec!(17.5);
assert_eq!(d.trunc().to_string(), "17.0");
let d = Dec!(-17.55555);
assert_eq!(d.trunc().to_string(), "-17.00000");
Returns the fractional part of self.
let d = Dec!(17.050);
assert_eq!(d.fract().to_string(), "0.050");
let d = Dec!(-17.5);
assert_eq!(d.fract().to_string(), "-0.5");
impl<const P: u8> Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Number of fractional decimal digits
Maximum value representable by this type
Minimum value representable by this type
Smallest absolute difference between two non-equal values of this type
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<Decimal<P>> for u8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
impl<const P: u8> Add<Decimal<P>> for i8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<Decimal<P>> for u16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
impl<const P: u8> Add<Decimal<P>> for i16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
impl<const P: u8> Add<Decimal<P>> for u32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
impl<const P: u8> Add<Decimal<P>> for i32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
impl<const P: u8> Add<Decimal<P>> for u64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
impl<const P: u8> Add<Decimal<P>> for i64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
impl<const P: u8> Add<Decimal<P>> for i128 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8, const Q: u8> Add<Decimal<Q>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ Q <= MAX_PREC }>: True,
PrecLimitCheck<{ const_max_u8(P, Q) <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<i128> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<i16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<i32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<i64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<i8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<u16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<u32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<u64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Add<u8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the + operator.
The resulting type after applying the + operator.
impl<const P: u8> Clone for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Performs copy-assignment from source. Read more
impl<const P: u8> Debug for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Formats the value using the given formatter. Read more
impl<const P: u8> Default for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Default value: Decimal::<P>::ZERO
impl<const P: u8> Display for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Formats the value using the given formatter.
If the format specifies less fractional digits than self.precision(),
the value gets rounded according to the default rounding mode.
let d = Dec!(-1234.56);
assert_eq!(format!("{}", d), "-1234.56");
assert_eq!(format!("{:014.3}", d), "-000001234.560");
assert_eq!(format!("{:10.1}", d), " -1234.6");
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<Decimal<P>> for u8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
impl<const P: u8> Div<Decimal<P>> for i8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<Decimal<P>> for u16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
impl<const P: u8> Div<Decimal<P>> for i16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
impl<const P: u8> Div<Decimal<P>> for u32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
impl<const P: u8> Div<Decimal<P>> for i32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
impl<const P: u8> Div<Decimal<P>> for u64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
impl<const P: u8> Div<Decimal<P>> for i64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
impl<const P: u8> Div<Decimal<P>> for i128 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8, const Q: u8> Div<Decimal<Q>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ Q <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<i128> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<i16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<i32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<i64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<i8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<u16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<u32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<u64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
impl<const P: u8> Div<u8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the / operator.
The resulting type after applying the / operator.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i128 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<i128, Decimal<R>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<i16, Decimal<R>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<i32, Decimal<R>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<i64, Decimal<R>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<i8, Decimal<R>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<u16, Decimal<R>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<u32, Decimal<R>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<u64, Decimal<R>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8, const R: u8> DivRounded<u8, Decimal<R>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ R <= MAX_PREC }>: True,
Returns self / other, rounded as Result.
Returns self / other, rounded as Result.
impl<const P: u8> From<i16> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
impl<const P: u8> From<i32> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
impl<const P: u8> From<i64> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
impl<const P: u8> From<i8> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
impl<const P: u8> From<u16> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
impl<const P: u8> From<u32> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
impl<const P: u8> From<u64> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
impl<const P: u8> From<u8> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
impl<const P: u8> FromStr for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Convert a number literal into a Decimal<P>.
The literal must be in the form
[+|-]<int>[.<frac>][<e|E>[+|-]<exp>]
or
[+|-].<frac>[<e|E>[+|-]<exp>].
The function returns an error in these cases:
- An empty string has been given as
lit -> ParseDecimalError::Empty
lit does not fit one of the two forms given above ->
ParseDecimalError::Invalid
- The number of fractional digits in
lit minus the value of the signed
exponent in lit exceeds the type parameter P ->
ParseDecimalError::PrecLimitExceeded
- The given decimal literal exceeds the maximum value representable by
the type -> ParseDecimalError::MaxValueExceeded
let d = Decimal::<4>::from_str("38.207")?;
assert_eq!(d.to_string(), "38.2070");
let d = Decimal::<7>::from_str("-132.0207e-2")?;
assert_eq!(d.to_string(), "-1.3202070");
The associated error which can be returned from parsing.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<Decimal<P>> for u8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
impl<const P: u8> Mul<Decimal<P>> for i8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<Decimal<P>> for u16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
impl<const P: u8> Mul<Decimal<P>> for i16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
impl<const P: u8> Mul<Decimal<P>> for u32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
impl<const P: u8> Mul<Decimal<P>> for i32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
impl<const P: u8> Mul<Decimal<P>> for u64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
impl<const P: u8> Mul<Decimal<P>> for i64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
impl<const P: u8> Mul<Decimal<P>> for i128 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8, const Q: u8> Mul<Decimal<Q>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ Q <= MAX_PREC }>: True,
PrecLimitCheck<{ (const_sum_u8(P, Q)) <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<i128> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<i16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<i32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<i64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<i8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<u16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<u32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<u64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
impl<const P: u8> Mul<u8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the * operator.
The resulting type after applying the * operator.
Returns self * other, rounded as Result.
Returns self * other, rounded as Result.
Returns self * other, rounded as Result.
Returns self * other, rounded as Result.
impl<const P: u8> Neg for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Returns -self.
Panics with ‘attempt to negate with overflow’ when called on
Decimal::<P>::MIN!
The resulting type after applying the - operator.
impl<const P: u8> Neg for &Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Returns -self.
#Panics
Panics with ‘attempt to negate with overflow’ when called on
Decimal::<P>::MIN!
The resulting type after applying the - operator.
impl<const P: u8> Ord for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
impl<const P: u8, const Q: u8> PartialEq<Decimal<Q>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ Q <= MAX_PREC }>: True,
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
impl<const P: u8, const Q: u8> PartialOrd<Decimal<Q>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ Q <= MAX_PREC }>: True,
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<Decimal<P>> for u8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
impl<const P: u8> Rem<Decimal<P>> for i8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<Decimal<P>> for u16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
impl<const P: u8> Rem<Decimal<P>> for i16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
impl<const P: u8> Rem<Decimal<P>> for u32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
impl<const P: u8> Rem<Decimal<P>> for i32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
impl<const P: u8> Rem<Decimal<P>> for u64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
impl<const P: u8> Rem<Decimal<P>> for i64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
impl<const P: u8> Rem<Decimal<P>> for i128 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8, const Q: u8> Rem<Decimal<Q>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ Q <= MAX_PREC }>: True,
PrecLimitCheck<{ const_max_u8(P, Q) <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<i128> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<i16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<i32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<i64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<i8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<u16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<u32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<u64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Rem<u8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the % operator.
The resulting type after applying the % operator.
impl<const P: u8> Round for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
Returns a new Decimal<P> with its value rounded to n_frac_digits
fractional digits according to the current RoundingMode.
Panics if the resulting value can not be represented by Decimal<P>!
let d = Dec!(28.27093);
let r = d.round(4);
assert_eq!(r.to_string(), "28.27090");
let r = d.round(1);
assert_eq!(r.to_string(), "28.30000");
let r = d.round(0);
assert_eq!(r.to_string(), "28.00000");
let r = d.round(-1);
assert_eq!(r.to_string(), "30.00000");
Returns a new Decimal<P> instance with its value rounded to
n_frac_digits fractional digits according to the current
RoundingMode, wrapped in Option::Some, or Option::None if the
result can not be represented by Decimal<P>.
let d = Dec!(28.27093);
let r = d.checked_round(4)?;
assert_eq!(r.to_string(), "28.27090");
let r = d.checked_round(0)?;
assert_eq!(r.to_string(), "28.00000");
let d = Decimal::<3>::MAX;
let r = d.checked_round(0);
assert_eq!(r, None);
impl<const P: u8, const Q: u8> RoundInto<Decimal<Q>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ Q <= MAX_PREC }>: True,
PrecLimitCheck<{ Q < P }>: True,
Returns a new Decimal<Q> instance with a value equivalent to
self.round(Q).
Panics if the result overflows Decimal::<Q>::MAX!
let d = Dec!(378.60350);
let r: Decimal<3> = d.round_into();
assert_eq!(r.to_string(), "378.604");
let r: Decimal<1> = d.round_into();
assert_eq!(r.to_string(), "378.6");
Returns a new i128 instance with a value equivalent to
self.round(0).
Panics if the result overflows i128::MAX!
let d = Dec!(378.603);
let i: i128 = d.round_into();
assert_eq!(i, 379);
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<Decimal<P>> for u8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
impl<const P: u8> Sub<Decimal<P>> for i8 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<Decimal<P>> for u16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
impl<const P: u8> Sub<Decimal<P>> for i16 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
impl<const P: u8> Sub<Decimal<P>> for u32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
impl<const P: u8> Sub<Decimal<P>> for i32 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
impl<const P: u8> Sub<Decimal<P>> for u64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
impl<const P: u8> Sub<Decimal<P>> for i64 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
impl<const P: u8> Sub<Decimal<P>> for i128 where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8, const Q: u8> Sub<Decimal<Q>> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
PrecLimitCheck<{ Q <= MAX_PREC }>: True,
PrecLimitCheck<{ const_max_u8(P, Q) <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<i128> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<i16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<i32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<i64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<i8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<u16> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<u32> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<u64> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> Sub<u8> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The resulting type after applying the - operator.
The resulting type after applying the - operator.
impl<const P: u8> TryFrom<&'_ str> for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
The type returned in the event of a conversion error.
impl<const P: u8> TryFrom<f32> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
The type returned in the event of a conversion error.
impl<const P: u8> TryFrom<f64> for Decimal<P> where
PrecLimitCheck<{ P <= crate::MAX_PREC }>: True,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
Returns the additive identity element of Self, 0. Read more
Returns true if self is equal to the additive identity.
Sets self to the additive identity element of Self, 0.
impl<const P: u8> Copy for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
impl<const P: u8> Eq for Decimal<P> where
PrecLimitCheck<{ P <= MAX_PREC }>: True,
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
T: Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Rem<Rhs, Output = Output> + Add<Rhs, Output = Output> + Sub<Rhs, Output = Output>,