pub struct Decimal<const P: u8>where
PrecLimitCheck<{ _ }>: True,{ /* private fields */ }
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
.
Implementations§
Source§impl<const P: u8> Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Sourcepub fn is_negative(&self) -> bool
pub fn is_negative(&self) -> bool
Returns true if self is less than zero.
Sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Returns true if self is greater than zero.
Source§impl<const P: u8> Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Sourcepub fn floor(&self) -> Self
pub fn floor(&self) -> Self
Returns the largest integral value <= self
.
§Panics
Panics with ‘attempt to multiply with overflow’ when called on a value less than
(Decimal::<P>::MIN / 10 ^ P) * 10 ^ P
!
§Examples
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");
Sourcepub fn ceil(&self) -> Self
pub fn ceil(&self) -> Self
Returns the smallest integral value >= self
.
§Panics
Panics with ‘attempt to multiply with overflow’ when called on a value greater than
(Decimal::<P>::MAX / 10 ^ P) * 10 ^ P
!
§Examples
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");
Trait Implementations§
Source§impl<const P: u8, const Q: u8> Add<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8> Add<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8, T> AddAssign<T> for Decimal<P>
impl<const P: u8, T> AddAssign<T> for Decimal<P>
Source§fn add_assign(&mut self, other: T)
fn add_assign(&mut self, other: T)
+=
operation. Read moreSource§impl<const P: u8> Display for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> Display for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§fn fmt(&self, form: &mut Formatter<'_>) -> Result
fn fmt(&self, form: &mut Formatter<'_>) -> Result
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.
§Examples:
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");
Source§impl<const P: u8, const Q: u8> Div<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8> Div<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8, T> DivAssign<T> for Decimal<P>
impl<const P: u8, T> DivAssign<T> for Decimal<P>
Source§fn div_assign(&mut self, other: T)
fn div_assign(&mut self, other: T)
/=
operation. Read moreSource§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i128where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i128: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i128where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i128: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i16: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i16: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i32: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i32: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i64: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i64: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i8: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &i8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i8: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &u16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u16: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &u16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u16: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &u32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u32: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &u32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u32: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &u64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u64: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &u64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u64: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &u8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u8: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for &u8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u8: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i128where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i128: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i128where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i128: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i16: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i16: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i32: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i32: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i64: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i64: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i8: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for i8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i8: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for u16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u16: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for u16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u16: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for u32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u32: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for u32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u32: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for u64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u64: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for u64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u64: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for u8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u8: DivRounded<Decimal<P>, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&Decimal<P>, Decimal<R>> for u8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u8: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const Q: u8, const R: u8> DivRounded<&Decimal<Q>, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<Decimal<Q>, Decimal<R>>,
impl<const P: u8, const Q: u8, const R: u8> DivRounded<&Decimal<Q>, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<Decimal<Q>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<Q>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<Q>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const Q: u8, const R: u8> DivRounded<&Decimal<Q>, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<Decimal<Q>, Decimal<R>>,
impl<const P: u8, const Q: u8, const R: u8> DivRounded<&Decimal<Q>, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<Decimal<Q>, Decimal<R>>,
Source§fn div_rounded(self, other: &Decimal<Q>) -> Decimal<R>
fn div_rounded(self, other: &Decimal<Q>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i128, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i128, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i128, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i128, Decimal<R>>,
Source§fn div_rounded(self, other: &i128) -> Decimal<R>
fn div_rounded(self, other: &i128) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i128, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i128, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i128, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i128, Decimal<R>>,
Source§fn div_rounded(self, other: &i128) -> Decimal<R>
fn div_rounded(self, other: &i128) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i16, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i16, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i16, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i16, Decimal<R>>,
Source§fn div_rounded(self, other: &i16) -> Decimal<R>
fn div_rounded(self, other: &i16) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i16, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i16, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i16, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i16, Decimal<R>>,
Source§fn div_rounded(self, other: &i16) -> Decimal<R>
fn div_rounded(self, other: &i16) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i32, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i32, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i32, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i32, Decimal<R>>,
Source§fn div_rounded(self, other: &i32) -> Decimal<R>
fn div_rounded(self, other: &i32) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i32, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i32, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i32, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i32, Decimal<R>>,
Source§fn div_rounded(self, other: &i32) -> Decimal<R>
fn div_rounded(self, other: &i32) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i64, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i64, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i64, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i64, Decimal<R>>,
Source§fn div_rounded(self, other: &i64) -> Decimal<R>
fn div_rounded(self, other: &i64) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i64, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i64, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i64, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i64, Decimal<R>>,
Source§fn div_rounded(self, other: &i64) -> Decimal<R>
fn div_rounded(self, other: &i64) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i8, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i8, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i8, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i8, Decimal<R>>,
Source§fn div_rounded(self, other: &i8) -> Decimal<R>
fn div_rounded(self, other: &i8) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&i8, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i8, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&i8, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i8, Decimal<R>>,
Source§fn div_rounded(self, other: &i8) -> Decimal<R>
fn div_rounded(self, other: &i8) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&u16, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u16, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&u16, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u16, Decimal<R>>,
Source§fn div_rounded(self, other: &u16) -> Decimal<R>
fn div_rounded(self, other: &u16) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&u16, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u16, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&u16, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u16, Decimal<R>>,
Source§fn div_rounded(self, other: &u16) -> Decimal<R>
fn div_rounded(self, other: &u16) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&u32, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u32, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&u32, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u32, Decimal<R>>,
Source§fn div_rounded(self, other: &u32) -> Decimal<R>
fn div_rounded(self, other: &u32) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&u32, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u32, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&u32, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u32, Decimal<R>>,
Source§fn div_rounded(self, other: &u32) -> Decimal<R>
fn div_rounded(self, other: &u32) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&u64, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u64, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&u64, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u64, Decimal<R>>,
Source§fn div_rounded(self, other: &u64) -> Decimal<R>
fn div_rounded(self, other: &u64) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&u64, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u64, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&u64, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u64, Decimal<R>>,
Source§fn div_rounded(self, other: &u64) -> Decimal<R>
fn div_rounded(self, other: &u64) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&u8, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u8, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&u8, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u8, Decimal<R>>,
Source§fn div_rounded(self, other: &u8) -> Decimal<R>
fn div_rounded(self, other: &u8) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<&u8, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u8, Decimal<R>>,
impl<const P: u8, const R: u8> DivRounded<&u8, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u8, Decimal<R>>,
Source§fn div_rounded(self, other: &u8) -> Decimal<R>
fn div_rounded(self, other: &u8) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i128where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i128: DivRounded<Decimal<P>, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i128where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i128: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i16: DivRounded<Decimal<P>, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i16: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i32: DivRounded<Decimal<P>, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i32: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i64: DivRounded<Decimal<P>, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i64: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i8: DivRounded<Decimal<P>, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a i8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
i8: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a u16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u16: DivRounded<Decimal<P>, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a u16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u16: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a u32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u32: DivRounded<Decimal<P>, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a u32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u32: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a u64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u64: DivRounded<Decimal<P>, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a u64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u64: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a u8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u8: DivRounded<Decimal<P>, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for &'a u8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
u8: DivRounded<Decimal<P>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i128where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i128where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for i8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u16where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u32where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u64where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<Decimal<P>, Decimal<R>> for u8where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
fn div_rounded(self, other: Decimal<P>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const Q: u8, const R: u8> DivRounded<Decimal<Q>, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<Decimal<Q>, Decimal<R>>,
impl<'a, const P: u8, const Q: u8, const R: u8> DivRounded<Decimal<Q>, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<Decimal<Q>, Decimal<R>>,
Source§fn div_rounded(self, other: Decimal<Q>) -> Decimal<R>
fn div_rounded(self, other: Decimal<Q>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const Q: u8, const R: u8> DivRounded<Decimal<Q>, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8, const R: u8> DivRounded<Decimal<Q>, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: Decimal<Q>) -> Decimal<R>
fn div_rounded(self, other: Decimal<Q>) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<i128, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i128, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<i128, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i128, Decimal<R>>,
Source§fn div_rounded(self, other: i128) -> Decimal<R>
fn div_rounded(self, other: i128) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<i128, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<i128, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: i128) -> Decimal<R>
fn div_rounded(self, other: i128) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<i16, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i16, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<i16, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i16, Decimal<R>>,
Source§fn div_rounded(self, other: i16) -> Decimal<R>
fn div_rounded(self, other: i16) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<i16, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<i16, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: i16) -> Decimal<R>
fn div_rounded(self, other: i16) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<i32, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i32, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<i32, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i32, Decimal<R>>,
Source§fn div_rounded(self, other: i32) -> Decimal<R>
fn div_rounded(self, other: i32) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<i32, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<i32, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: i32) -> Decimal<R>
fn div_rounded(self, other: i32) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<i64, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i64, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<i64, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i64, Decimal<R>>,
Source§fn div_rounded(self, other: i64) -> Decimal<R>
fn div_rounded(self, other: i64) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<i64, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<i64, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: i64) -> Decimal<R>
fn div_rounded(self, other: i64) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<i8, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i8, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<i8, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<i8, Decimal<R>>,
Source§fn div_rounded(self, other: i8) -> Decimal<R>
fn div_rounded(self, other: i8) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<i8, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<i8, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: i8) -> Decimal<R>
fn div_rounded(self, other: i8) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<u16, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u16, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<u16, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u16, Decimal<R>>,
Source§fn div_rounded(self, other: u16) -> Decimal<R>
fn div_rounded(self, other: u16) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<u16, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<u16, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: u16) -> Decimal<R>
fn div_rounded(self, other: u16) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<u32, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u32, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<u32, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u32, Decimal<R>>,
Source§fn div_rounded(self, other: u32) -> Decimal<R>
fn div_rounded(self, other: u32) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<u32, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<u32, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: u32) -> Decimal<R>
fn div_rounded(self, other: u32) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<u64, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u64, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<u64, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u64, Decimal<R>>,
Source§fn div_rounded(self, other: u64) -> Decimal<R>
fn div_rounded(self, other: u64) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<u64, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<u64, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: u64) -> Decimal<R>
fn div_rounded(self, other: u64) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<'a, const P: u8, const R: u8> DivRounded<u8, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u8, Decimal<R>>,
impl<'a, const P: u8, const R: u8> DivRounded<u8, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: DivRounded<u8, Decimal<R>>,
Source§fn div_rounded(self, other: u8) -> Decimal<R>
fn div_rounded(self, other: u8) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8, const R: u8> DivRounded<u8, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const R: u8> DivRounded<u8, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn div_rounded(self, other: u8) -> Decimal<R>
fn div_rounded(self, other: u8) -> Decimal<R>
self
/ other
, rounded as Result
.Source§impl<const P: u8> FromStr for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> FromStr for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§fn from_str(lit: &str) -> Result<Self, Self::Err>
fn from_str(lit: &str) -> Result<Self, Self::Err>
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 inlit
exceeds the type parameterP
->ParseDecimalError::PrecLimitExceeded
- The given decimal literal exceeds the maximum value representable by the type -> ParseDecimalError::MaxValueExceeded
§Examples:
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");
Source§type Err = ParseDecimalError
type Err = ParseDecimalError
Source§impl<const P: u8, const Q: u8> Mul<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8> Mul<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8, T> MulAssign<T> for Decimal<P>
impl<const P: u8, T> MulAssign<T> for Decimal<P>
Source§fn mul_assign(&mut self, other: T)
fn mul_assign(&mut self, other: T)
*=
operation. Read moreSource§impl<const P: u8, const Q: u8, const R: u8> MulRounded<&Decimal<Q>, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: MulRounded<Decimal<Q>, Decimal<R>>,
impl<const P: u8, const Q: u8, const R: u8> MulRounded<&Decimal<Q>, Decimal<R>> for &Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: MulRounded<Decimal<Q>, Decimal<R>>,
Source§fn mul_rounded(self, other: &Decimal<Q>) -> Decimal<R>
fn mul_rounded(self, other: &Decimal<Q>) -> Decimal<R>
self
* other
, rounded as Result
.Source§impl<const P: u8, const Q: u8, const R: u8> MulRounded<&Decimal<Q>, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: MulRounded<Decimal<Q>, Decimal<R>>,
impl<const P: u8, const Q: u8, const R: u8> MulRounded<&Decimal<Q>, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: MulRounded<Decimal<Q>, Decimal<R>>,
Source§fn mul_rounded(self, other: &Decimal<Q>) -> Decimal<R>
fn mul_rounded(self, other: &Decimal<Q>) -> Decimal<R>
self
* other
, rounded as Result
.Source§impl<'a, const P: u8, const Q: u8, const R: u8> MulRounded<Decimal<Q>, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: MulRounded<Decimal<Q>, Decimal<R>>,
impl<'a, const P: u8, const Q: u8, const R: u8> MulRounded<Decimal<Q>, Decimal<R>> for &'a Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Decimal<P>: MulRounded<Decimal<Q>, Decimal<R>>,
Source§fn mul_rounded(self, other: Decimal<Q>) -> Decimal<R>
fn mul_rounded(self, other: Decimal<Q>) -> Decimal<R>
self
* other
, rounded as Result
.Source§impl<const P: u8, const Q: u8, const R: u8> MulRounded<Decimal<Q>, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8, const R: u8> MulRounded<Decimal<Q>, Decimal<R>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn mul_rounded(self, other: Decimal<Q>) -> Decimal<R>
fn mul_rounded(self, other: Decimal<Q>) -> Decimal<R>
self
* other
, rounded as Result
.Source§impl<const P: u8> Ord for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> Ord for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<const P: u8, const Q: u8> PartialEq<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8> PartialEq<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8, const Q: u8> PartialOrd<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8> PartialOrd<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§impl<const Q: u8> PartialOrd<Decimal<Q>> for i128where
PrecLimitCheck<{ _ }>: True,
impl<const Q: u8> PartialOrd<Decimal<Q>> for i128where
PrecLimitCheck<{ _ }>: True,
Source§impl<const Q: u8> PartialOrd<Decimal<Q>> for i16where
PrecLimitCheck<{ _ }>: True,
impl<const Q: u8> PartialOrd<Decimal<Q>> for i16where
PrecLimitCheck<{ _ }>: True,
Source§impl<const Q: u8> PartialOrd<Decimal<Q>> for i32where
PrecLimitCheck<{ _ }>: True,
impl<const Q: u8> PartialOrd<Decimal<Q>> for i32where
PrecLimitCheck<{ _ }>: True,
Source§impl<const Q: u8> PartialOrd<Decimal<Q>> for i64where
PrecLimitCheck<{ _ }>: True,
impl<const Q: u8> PartialOrd<Decimal<Q>> for i64where
PrecLimitCheck<{ _ }>: True,
Source§impl<const Q: u8> PartialOrd<Decimal<Q>> for i8where
PrecLimitCheck<{ _ }>: True,
impl<const Q: u8> PartialOrd<Decimal<Q>> for i8where
PrecLimitCheck<{ _ }>: True,
Source§impl<const Q: u8> PartialOrd<Decimal<Q>> for u16where
PrecLimitCheck<{ _ }>: True,
impl<const Q: u8> PartialOrd<Decimal<Q>> for u16where
PrecLimitCheck<{ _ }>: True,
Source§impl<const Q: u8> PartialOrd<Decimal<Q>> for u32where
PrecLimitCheck<{ _ }>: True,
impl<const Q: u8> PartialOrd<Decimal<Q>> for u32where
PrecLimitCheck<{ _ }>: True,
Source§impl<const Q: u8> PartialOrd<Decimal<Q>> for u64where
PrecLimitCheck<{ _ }>: True,
impl<const Q: u8> PartialOrd<Decimal<Q>> for u64where
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8> PartialOrd<i128> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> PartialOrd<i128> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8> PartialOrd<i16> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> PartialOrd<i16> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8> PartialOrd<i32> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> PartialOrd<i32> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8> PartialOrd<i64> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> PartialOrd<i64> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8> PartialOrd<i8> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> PartialOrd<i8> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8> PartialOrd<u16> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> PartialOrd<u16> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8> PartialOrd<u32> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> PartialOrd<u32> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8> PartialOrd<u64> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> PartialOrd<u64> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8, const Q: u8> Rem<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8> Rem<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8, T> RemAssign<T> for Decimal<P>
impl<const P: u8, T> RemAssign<T> for Decimal<P>
Source§fn rem_assign(&mut self, other: T)
fn rem_assign(&mut self, other: T)
%=
operation. Read moreSource§impl<const P: u8> Round for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
impl<const P: u8> Round for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
Source§fn round(self, n_frac_digits: i8) -> Self
fn round(self, n_frac_digits: i8) -> Self
Returns a new Decimal<P>
with its value rounded to n_frac_digits
fractional digits according to the current RoundingMode
.
§Panics
Panics if the resulting value can not be represented by Decimal<P>
!
§Examples
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");
Source§fn checked_round(self, n_frac_digits: i8) -> Option<Self>
fn checked_round(self, n_frac_digits: i8) -> Option<Self>
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>
.
§Examples
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);
Source§impl<const P: u8, const Q: u8> RoundInto<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8> RoundInto<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§fn round_into(self) -> Decimal<Q>
fn round_into(self) -> Decimal<Q>
Returns a new Decimal<Q>
instance with a value equivalent to
self.round(Q)
.
§Panics
Panics if the result overflows Decimal::<Q>::MAX
or
Decimal::<Q>::MIN
!
§Examples
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");
Source§impl<const P: u8, const Q: u8> Sub<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
impl<const P: u8, const Q: u8> Sub<Decimal<Q>> for Decimal<P>where
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
PrecLimitCheck<{ _ }>: True,
Source§impl<const P: u8, T> SubAssign<T> for Decimal<P>
impl<const P: u8, T> SubAssign<T> for Decimal<P>
Source§fn sub_assign(&mut self, other: T)
fn sub_assign(&mut self, other: T)
-=
operation. Read more