pub struct FixedDecimal9(i64);Expand description
A fixed-point decimal arithmetic for 9 decimal places. This type represents
a number x by the integer x * 10^9, backed by a i64.
Tuple Fields§
§0: i64Implementations§
Source§impl FixedDecimal9
impl FixedDecimal9
Trait Implementations§
Source§impl Add<&FixedDecimal9> for &FixedDecimal9
impl Add<&FixedDecimal9> for &FixedDecimal9
Source§type Output = FixedDecimal9
type Output = FixedDecimal9
The resulting type after applying the
+ operator.Source§fn add(self, rhs: &FixedDecimal9) -> FixedDecimal9
fn add(self, rhs: &FixedDecimal9) -> FixedDecimal9
Performs the
+ operation. Read moreSource§impl Add<&FixedDecimal9> for FixedDecimal9
impl Add<&FixedDecimal9> for FixedDecimal9
Source§impl Add for FixedDecimal9
impl Add for FixedDecimal9
Source§impl AddAssign<&FixedDecimal9> for FixedDecimal9
impl AddAssign<&FixedDecimal9> for FixedDecimal9
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
Performs the
+= operation. Read moreSource§impl AddAssign for FixedDecimal9
impl AddAssign for FixedDecimal9
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl Clone for FixedDecimal9
impl Clone for FixedDecimal9
Source§fn clone(&self) -> FixedDecimal9
fn clone(&self) -> FixedDecimal9
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FixedDecimal9
impl Debug for FixedDecimal9
Source§impl Display for FixedDecimal9
impl Display for FixedDecimal9
Source§impl Div<&Integer64> for &FixedDecimal9
impl Div<&Integer64> for &FixedDecimal9
Source§type Output = FixedDecimal9
type Output = FixedDecimal9
The resulting type after applying the
/ operator.Source§impl Div<Integer64> for FixedDecimal9
impl Div<Integer64> for FixedDecimal9
Source§impl DivAssign<&Integer64> for FixedDecimal9
impl DivAssign<&Integer64> for FixedDecimal9
Source§fn div_assign(&mut self, rhs: &Integer64)
fn div_assign(&mut self, rhs: &Integer64)
Performs the
/= operation. Read moreSource§impl Mul<&FixedDecimal9> for &FixedDecimal9
impl Mul<&FixedDecimal9> for &FixedDecimal9
Source§type Output = FixedDecimal9
type Output = FixedDecimal9
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &FixedDecimal9) -> FixedDecimal9
fn mul(self, rhs: &FixedDecimal9) -> FixedDecimal9
Performs the
* operation. Read moreSource§impl Mul<&FixedDecimal9> for FixedDecimal9
impl Mul<&FixedDecimal9> for FixedDecimal9
Source§impl Mul<&Integer64> for &FixedDecimal9
impl Mul<&Integer64> for &FixedDecimal9
Source§type Output = FixedDecimal9
type Output = FixedDecimal9
The resulting type after applying the
* operator.Source§impl Mul<Integer64> for FixedDecimal9
impl Mul<Integer64> for FixedDecimal9
Source§impl Mul for FixedDecimal9
impl Mul for FixedDecimal9
Source§impl MulAssign<&FixedDecimal9> for FixedDecimal9
impl MulAssign<&FixedDecimal9> for FixedDecimal9
Source§fn mul_assign(&mut self, rhs: &Self)
fn mul_assign(&mut self, rhs: &Self)
Performs the
*= operation. Read moreSource§impl MulAssign for FixedDecimal9
impl MulAssign for FixedDecimal9
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl One for FixedDecimal9
impl One for FixedDecimal9
Source§impl PartialEq for FixedDecimal9
impl PartialEq for FixedDecimal9
Source§impl PartialOrd for FixedDecimal9
impl PartialOrd for FixedDecimal9
Source§impl Product for FixedDecimal9
impl Product for FixedDecimal9
Source§impl Rational<Integer64> for FixedDecimal9
impl Rational<Integer64> for FixedDecimal9
Source§fn ratio_i(num: Integer64, denom: Integer64) -> Self
fn ratio_i(num: Integer64, denom: Integer64) -> Self
Obtains a number equal to the ratio between the given numerator and
denominator.
Source§fn to_f64(&self) -> f64
fn to_f64(&self) -> f64
Converts a number into its floating-point approximation. This can be
useful to print approximation of large numbers.
Source§fn is_exact() -> bool
fn is_exact() -> bool
Whether this type represents exact arithmetic, i.e.
Self::epsilon()
is zero.Source§fn description() -> &'static str
fn description() -> &'static str
Description of the implemented arithmetic, e.g. “64-bit floating point
arithmetic”.
Source§fn mul_up(&self, rhs: &Self) -> Self
fn mul_up(&self, rhs: &Self) -> Self
Multiplication, rounding up for types that perform a rounding on this
operation.
Source§fn div_up_as_keep_factor(&self, rhs: &Self) -> Self
fn div_up_as_keep_factor(&self, rhs: &Self) -> Self
Performs a division to obtain a keep factor. The division is rounded up
for types that cannot compute the result precisely. Additionally,
types may further round the result, which can be useful with exact
arithmetic, to avoid complexity explosion of rational numbers.
Source§fn from_usize(i: usize) -> Self
fn from_usize(i: usize) -> Self
Obtains a number equal to the given integer.
Source§impl Sub<&FixedDecimal9> for &FixedDecimal9
impl Sub<&FixedDecimal9> for &FixedDecimal9
Source§type Output = FixedDecimal9
type Output = FixedDecimal9
The resulting type after applying the
- operator.Source§fn sub(self, rhs: &FixedDecimal9) -> FixedDecimal9
fn sub(self, rhs: &FixedDecimal9) -> FixedDecimal9
Performs the
- operation. Read moreSource§impl Sub<&FixedDecimal9> for FixedDecimal9
impl Sub<&FixedDecimal9> for FixedDecimal9
Source§impl Sub for FixedDecimal9
impl Sub for FixedDecimal9
Source§impl SubAssign<&FixedDecimal9> for FixedDecimal9
impl SubAssign<&FixedDecimal9> for FixedDecimal9
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
Performs the
-= operation. Read moreSource§impl SubAssign for FixedDecimal9
impl SubAssign for FixedDecimal9
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl<'a> Sum<&'a FixedDecimal9> for FixedDecimal9
impl<'a> Sum<&'a FixedDecimal9> for FixedDecimal9
Source§impl Sum for FixedDecimal9
impl Sum for FixedDecimal9
Source§impl Zero for FixedDecimal9
impl Zero for FixedDecimal9
impl Copy for FixedDecimal9
impl Eq for FixedDecimal9
impl RationalRef<&Integer64, FixedDecimal9> for &FixedDecimal9
impl StructuralPartialEq for FixedDecimal9
Auto Trait Implementations§
impl Freeze for FixedDecimal9
impl RefUnwindSafe for FixedDecimal9
impl Send for FixedDecimal9
impl Sync for FixedDecimal9
impl Unpin for FixedDecimal9
impl UnwindSafe for FixedDecimal9
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more