Struct fraction::prelude::GenericDecimal
source · pub struct GenericDecimal<T, P>(/* private fields */)
where
T: Clone + Integer,
P: Copy + Integer + Into<usize>;
Expand description
Decimal type implementation
T is the type for data P is the type for precision
Uses GenericFraction
§Examples
use fraction::GenericDecimal;
type Decimal = GenericDecimal<u64, u8>;
let d1 = Decimal::from(12);
let d2 = Decimal::from(0.5);
let mul = d1 * d2;
let div = d1 / d2;
let add = d1 + d2;
assert_eq!(mul, 6.into());
assert_eq!(div, Decimal::from("24.00"));
assert_eq!(add, Decimal::from(12.5));
Implementations§
source§impl<T, P> GenericDecimal<T, P>
impl<T, P> GenericDecimal<T, P>
sourcepub const fn sign(&self) -> Option<Sign>
pub const fn sign(&self) -> Option<Sign>
Returns Some(Sign) of the decimal, or None if NaN is the value
sourcepub fn set_precision(self, precision: P) -> Self
pub fn set_precision(self, precision: P) -> Self
Sets representational precision for the Decimal The precision is only used for comparison and representation, not for calculations.
This is suggested method for you to utilise if you know what precision you want to work with.
§Examples
use fraction::GenericDecimal;
type D = GenericDecimal<u32, u8>;
let first = D::from("0.004") // initial precision is 4
.set_precision(2); // but we want to work with 2
let second = D::from("0.006").set_precision(2);
// Even though "first" and "second" both have precision 2
// the actual calculations are still performed with their
// exact initial precision
assert_eq!(first + second, D::from("0.01"));
// The comparison, on the other hand, takes the precision into account
// so the actual compared numbers will be calculated up the highest
// precision of both operands
assert_ne!( // compares "0.010" with "0.011"
D::from("0.01"), // has precision 2
D::from("0.011") // has precision 3
);
assert_eq!( // compares "0.01" with "0.01"
D::from("0.01").set_precision(2),
D::from("0.011").set_precision(2)
);
sourcepub const fn get_precision(&self) -> P
pub const fn get_precision(&self) -> P
Returns the current representational precision for the Decimal
sourcepub fn calc_precision(self, max_precision: Option<P>) -> Selfwhere
T: CheckedMul + DivAssign + MulAssign + SubAssign + ToPrimitive + GenericInteger,
P: Bounded + CheckedAdd,
pub fn calc_precision(self, max_precision: Option<P>) -> Selfwhere
T: CheckedMul + DivAssign + MulAssign + SubAssign + ToPrimitive + GenericInteger,
P: Bounded + CheckedAdd,
Try to recalculate the representational precision depending on the internal Fraction, which is the actual value.
Performs the actual division until the exact decimal value is calculated, the precision type (P) capacity is reached (e.g. 255 for u8) or max_precision is reached, if it is given.
§WARNING
You only need this method if you want to find the max available
precision for the current decimal value.
However, keep in mind that irrational values (such as 1/3) do not have finite precision,
so if this method returns P::MAX (or max_precision), most likely you have
an irrational value.
Be careful with max numbers for usize
- that can take very long time to
compute (more than a minute)
pub fn nan() -> Self
pub fn infinity() -> Self
pub fn neg_infinity() -> Self
pub fn neg_zero() -> Self
pub fn min_positive_value() -> Self
pub const fn is_nan(&self) -> bool
pub const fn is_infinite(&self) -> bool
pub const fn is_finite(&self) -> bool
pub fn is_normal(&self) -> bool
pub fn classify(&self) -> FpCategory
pub fn floor(&self) -> Self
pub fn ceil(&self) -> Self
pub fn round(&self) -> Self
pub fn trunc(&self) -> Self
pub fn fract(&self) -> Self
pub fn abs(&self) -> Self
pub fn signum(&self) -> Self
pub const fn is_sign_positive(&self) -> bool
pub const fn is_sign_negative(&self) -> bool
pub fn mul_add(&self, a: Self, b: Self) -> Self
pub fn recip(&self) -> Self
pub fn map( self, fun: impl FnOnce(GenericFraction<T>) -> GenericFraction<T>, ) -> Self
pub fn map_mut(&mut self, fun: impl FnOnce(&mut GenericFraction<T>))
pub fn map_ref( &self, fun: impl FnOnce(&GenericFraction<T>) -> GenericFraction<T>, ) -> Self
pub fn apply_ref<R>(&self, fun: impl FnOnce(&GenericFraction<T>, P) -> R) -> R
match decimal {GenericDecimal(fraction, precision) => ... }
sourcepub fn from_fraction(fraction: GenericFraction<T>) -> Self
pub fn from_fraction(fraction: GenericFraction<T>) -> Self
Convert from a GenericFraction
Automatically calculates precision, so for “bad” numbers may take a lot of CPU cycles, especially if precision represented by big types (e.g. usize)
§Examples
use fraction::{Fraction, Decimal};
let from_fraction = Decimal::from_fraction(Fraction::new(1u64, 3u64));
let from_division = Decimal::from(1) / Decimal::from(3);
let d1 = Decimal::from(4) / from_fraction;
let d2 = Decimal::from(4) / from_division;
assert_eq!(d1, d2);
assert_eq!(d1, Decimal::from(12));
Trait Implementations§
source§impl<'a, O, T, P> Add<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
&'a T: Add<Output = T>,
O: Into<GenericDecimal<T, P>>,
impl<'a, O, T, P> Add<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
&'a T: Add<Output = T>,
O: Into<GenericDecimal<T, P>>,
source§impl<O, T, P> Add<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
impl<O, T, P> Add<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
source§impl<'a, T, P> Add for &'a GenericDecimal<T, P>
impl<'a, T, P> Add for &'a GenericDecimal<T, P>
source§impl<'a, T, P> AddAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
impl<'a, T, P> AddAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
source§fn add_assign(&mut self, other: &'a Self)
fn add_assign(&mut self, other: &'a Self)
+=
operation. Read moresource§impl<O, T, P> AddAssign<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger + AddAssign + MulAssign,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
impl<O, T, P> AddAssign<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger + AddAssign + MulAssign,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
source§fn add_assign(&mut self, other: O)
fn add_assign(&mut self, other: O)
+=
operation. Read moresource§impl<T, P> Bounded for GenericDecimal<T, P>
impl<T, P> Bounded for GenericDecimal<T, P>
source§impl<T, P> CheckedAdd for GenericDecimal<T, P>
impl<T, P> CheckedAdd for GenericDecimal<T, P>
source§fn checked_add(&self, other: &Self) -> Option<Self>
fn checked_add(&self, other: &Self) -> Option<Self>
None
is
returned.source§impl<T, P> CheckedDiv for GenericDecimal<T, P>
impl<T, P> CheckedDiv for GenericDecimal<T, P>
source§fn checked_div(&self, other: &Self) -> Option<Self>
fn checked_div(&self, other: &Self) -> Option<Self>
None
is returned.source§impl<T, P> CheckedMul for GenericDecimal<T, P>
impl<T, P> CheckedMul for GenericDecimal<T, P>
source§fn checked_mul(&self, other: &Self) -> Option<Self>
fn checked_mul(&self, other: &Self) -> Option<Self>
None
is returned.source§impl<T, P> CheckedSub for GenericDecimal<T, P>
impl<T, P> CheckedSub for GenericDecimal<T, P>
source§fn checked_sub(&self, other: &Self) -> Option<Self>
fn checked_sub(&self, other: &Self) -> Option<Self>
None
is returned.source§impl<T, P> Clone for GenericDecimal<T, P>
impl<T, P> Clone for GenericDecimal<T, P>
source§fn clone(&self) -> GenericDecimal<T, P>
fn clone(&self) -> GenericDecimal<T, P>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T, P> Debug for GenericDecimal<T, P>
impl<T, P> Debug for GenericDecimal<T, P>
source§impl<T, P> Default for GenericDecimal<T, P>
impl<T, P> Default for GenericDecimal<T, P>
source§impl<T, P> Display for GenericDecimal<T, P>
impl<T, P> Display for GenericDecimal<T, P>
source§impl<'a, O, T, P> Div<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger + Div,
P: Copy + GenericInteger + Into<usize>,
&'a T: Div<Output = T>,
O: Into<GenericDecimal<T, P>>,
impl<'a, O, T, P> Div<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger + Div,
P: Copy + GenericInteger + Into<usize>,
&'a T: Div<Output = T>,
O: Into<GenericDecimal<T, P>>,
source§impl<O, T, P> Div<O> for GenericDecimal<T, P>
impl<O, T, P> Div<O> for GenericDecimal<T, P>
source§impl<'a, T, P> Div for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger + Div,
P: Copy + GenericInteger + Into<usize>,
&'a T: Div<Output = T>,
impl<'a, T, P> Div for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger + Div,
P: Copy + GenericInteger + Into<usize>,
&'a T: Div<Output = T>,
source§impl<'a, T, P> DivAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
impl<'a, T, P> DivAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
source§fn div_assign(&mut self, other: &'a Self)
fn div_assign(&mut self, other: &'a Self)
/=
operation. Read moresource§impl<O, T, P> DivAssign<O> for GenericDecimal<T, P>
impl<O, T, P> DivAssign<O> for GenericDecimal<T, P>
source§fn div_assign(&mut self, other: O)
fn div_assign(&mut self, other: O)
/=
operation. Read moresource§impl<'a, T, P> From<&'a str> for GenericDecimal<T, P>
impl<'a, T, P> From<&'a str> for GenericDecimal<T, P>
source§impl<T, P> From<BigInt> for GenericDecimal<T, P>
impl<T, P> From<BigInt> for GenericDecimal<T, P>
source§impl<T, P> From<BigUint> for GenericDecimal<T, P>
impl<T, P> From<BigUint> for GenericDecimal<T, P>
source§impl<T, P> From<f32> for GenericDecimal<T, P>where
T: Clone + GenericInteger + FromPrimitive,
P: Copy + GenericInteger + Into<usize> + From<u8> + Bounded,
impl<T, P> From<f32> for GenericDecimal<T, P>where
T: Clone + GenericInteger + FromPrimitive,
P: Copy + GenericInteger + Into<usize> + From<u8> + Bounded,
source§impl<T, P> From<f64> for GenericDecimal<T, P>where
T: Clone + GenericInteger + FromPrimitive,
P: Copy + GenericInteger + Into<usize> + From<u8> + Bounded,
impl<T, P> From<f64> for GenericDecimal<T, P>where
T: Clone + GenericInteger + FromPrimitive,
P: Copy + GenericInteger + Into<usize> + From<u8> + Bounded,
source§impl<T, P> From<i128> for GenericDecimal<T, P>
impl<T, P> From<i128> for GenericDecimal<T, P>
source§impl<T, P> From<i16> for GenericDecimal<T, P>
impl<T, P> From<i16> for GenericDecimal<T, P>
source§impl<T, P> From<i32> for GenericDecimal<T, P>
impl<T, P> From<i32> for GenericDecimal<T, P>
source§impl<T, P> From<i64> for GenericDecimal<T, P>
impl<T, P> From<i64> for GenericDecimal<T, P>
source§impl<T, P> From<i8> for GenericDecimal<T, P>
impl<T, P> From<i8> for GenericDecimal<T, P>
source§impl<T, P> From<isize> for GenericDecimal<T, P>
impl<T, P> From<isize> for GenericDecimal<T, P>
source§impl<T, P> From<u128> for GenericDecimal<T, P>
impl<T, P> From<u128> for GenericDecimal<T, P>
source§impl<T, P> From<u16> for GenericDecimal<T, P>
impl<T, P> From<u16> for GenericDecimal<T, P>
source§impl<T, P> From<u32> for GenericDecimal<T, P>
impl<T, P> From<u32> for GenericDecimal<T, P>
source§impl<T, P> From<u64> for GenericDecimal<T, P>
impl<T, P> From<u64> for GenericDecimal<T, P>
source§impl<T, P> From<u8> for GenericDecimal<T, P>
impl<T, P> From<u8> for GenericDecimal<T, P>
source§impl<T, P> From<usize> for GenericDecimal<T, P>
impl<T, P> From<usize> for GenericDecimal<T, P>
source§impl<T, P> FromStr for GenericDecimal<T, P>where
T: Clone + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
P: Copy + GenericInteger + Into<usize> + From<u8> + CheckedAdd,
impl<T, P> FromStr for GenericDecimal<T, P>where
T: Clone + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
P: Copy + GenericInteger + Into<usize> + From<u8> + CheckedAdd,
source§impl<T, P> Hash for GenericDecimal<T, P>
impl<T, P> Hash for GenericDecimal<T, P>
source§impl<'a, O, T, P> Mul<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
&'a T: Mul<Output = T>,
O: Into<GenericDecimal<T, P>>,
impl<'a, O, T, P> Mul<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
&'a T: Mul<Output = T>,
O: Into<GenericDecimal<T, P>>,
source§impl<O, T, P> Mul<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
impl<O, T, P> Mul<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
source§impl<'a, T, P> Mul for &'a GenericDecimal<T, P>
impl<'a, T, P> Mul for &'a GenericDecimal<T, P>
source§impl<'a, T, P> MulAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
impl<'a, T, P> MulAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
source§fn mul_assign(&mut self, other: &'a Self)
fn mul_assign(&mut self, other: &'a Self)
*=
operation. Read moresource§impl<O, T, P> MulAssign<O> for GenericDecimal<T, P>
impl<O, T, P> MulAssign<O> for GenericDecimal<T, P>
source§fn mul_assign(&mut self, other: O)
fn mul_assign(&mut self, other: O)
*=
operation. Read moresource§impl<'a, T, P> Neg for &'a GenericDecimal<T, P>
impl<'a, T, P> Neg for &'a GenericDecimal<T, P>
source§impl<T, P> Neg for GenericDecimal<T, P>
impl<T, P> Neg for GenericDecimal<T, P>
source§impl<T, P> Num for GenericDecimal<T, P>
impl<T, P> Num for GenericDecimal<T, P>
type FromStrRadixErr = ParseError
source§fn from_str_radix(value: &str, base: u32) -> Result<Self, ParseError>
fn from_str_radix(value: &str, base: u32) -> Result<Self, ParseError>
2..=36
). Read moresource§impl<T, P> One for GenericDecimal<T, P>
impl<T, P> One for GenericDecimal<T, P>
source§impl<T, P> Ord for GenericDecimal<T, P>
impl<T, P> Ord for GenericDecimal<T, P>
source§impl<T, P> PartialEq for GenericDecimal<T, P>
impl<T, P> PartialEq for GenericDecimal<T, P>
source§impl<T, P> PartialOrd for GenericDecimal<T, P>
impl<T, P> PartialOrd for GenericDecimal<T, P>
source§impl<'a, T, P> Product<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
impl<'a, T, P> Product<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
source§impl<T, P> Product for GenericDecimal<T, P>
impl<T, P> Product for GenericDecimal<T, P>
source§impl<'a, O, T, P> Rem<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
&'a T: Rem<Output = T>,
O: Into<GenericDecimal<T, P>>,
impl<'a, O, T, P> Rem<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
&'a T: Rem<Output = T>,
O: Into<GenericDecimal<T, P>>,
source§impl<O, T, P> Rem<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
impl<O, T, P> Rem<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
source§impl<'a, T, P> Rem for &'a GenericDecimal<T, P>
impl<'a, T, P> Rem for &'a GenericDecimal<T, P>
source§impl<'a, T, P> RemAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
impl<'a, T, P> RemAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
source§fn rem_assign(&mut self, other: &'a Self)
fn rem_assign(&mut self, other: &'a Self)
%=
operation. Read moresource§impl<O, T, P> RemAssign<O> for GenericDecimal<T, P>
impl<O, T, P> RemAssign<O> for GenericDecimal<T, P>
source§fn rem_assign(&mut self, other: O)
fn rem_assign(&mut self, other: O)
%=
operation. Read moresource§impl<T, P> Signed for GenericDecimal<T, P>
impl<T, P> Signed for GenericDecimal<T, P>
source§fn is_positive(&self) -> bool
fn is_positive(&self) -> bool
source§fn is_negative(&self) -> bool
fn is_negative(&self) -> bool
source§impl<'a, O, T, P> Sub<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
&'a T: Sub<Output = T>,
O: Into<GenericDecimal<T, P>>,
impl<'a, O, T, P> Sub<O> for &'a GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
&'a T: Sub<Output = T>,
O: Into<GenericDecimal<T, P>>,
source§impl<O, T, P> Sub<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
impl<O, T, P> Sub<O> for GenericDecimal<T, P>where
T: Clone + GenericInteger,
P: Copy + GenericInteger + Into<usize>,
O: Into<GenericDecimal<T, P>>,
source§impl<'a, T, P> Sub for &'a GenericDecimal<T, P>
impl<'a, T, P> Sub for &'a GenericDecimal<T, P>
source§impl<'a, T, P> SubAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
impl<'a, T, P> SubAssign<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
source§fn sub_assign(&mut self, other: &'a Self)
fn sub_assign(&mut self, other: &'a Self)
-=
operation. Read moresource§impl<O, T, P> SubAssign<O> for GenericDecimal<T, P>
impl<O, T, P> SubAssign<O> for GenericDecimal<T, P>
source§fn sub_assign(&mut self, other: O)
fn sub_assign(&mut self, other: O)
-=
operation. Read moresource§impl<'a, T, P> Sum<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
impl<'a, T, P> Sum<&'a GenericDecimal<T, P>> for GenericDecimal<T, P>
source§impl<T, P> Sum for GenericDecimal<T, P>
impl<T, P> Sum for GenericDecimal<T, P>
source§impl<T, P> ToPrimitive for GenericDecimal<T, P>
impl<T, P> ToPrimitive for GenericDecimal<T, P>
source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
self
to an i64
. If the value cannot be
represented by an i64
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
self
to a u64
. If the value cannot be
represented by a u64
, then None
is returned.source§fn to_f64(&self) -> Option<f64>
fn to_f64(&self) -> Option<f64>
self
to an f64
. Overflows may map to positive
or negative inifinity, otherwise None
is returned if the value cannot
be represented by an f64
. Read moresource§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
self
to an isize
. If the value cannot be
represented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
self
to an i8
. If the value cannot be
represented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
self
to an i16
. If the value cannot be
represented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
self
to an i32
. If the value cannot be
represented by an i32
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
self
to an i128
. If the value cannot be
represented by an i128
(i64
under the default implementation), then
None
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
self
to a usize
. If the value cannot be
represented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
self
to a u8
. If the value cannot be
represented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
self
to a u16
. If the value cannot be
represented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
self
to a u32
. If the value cannot be
represented by a u32
, then None
is returned.source§impl<T, P> TryFrom<GenericDecimal<T, P>> for BigInt
impl<T, P> TryFrom<GenericDecimal<T, P>> for BigInt
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for BigUint
impl<T, P> TryFrom<GenericDecimal<T, P>> for BigUint
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for f32
impl<T, P> TryFrom<GenericDecimal<T, P>> for f32
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for f64
impl<T, P> TryFrom<GenericDecimal<T, P>> for f64
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for i128
impl<T, P> TryFrom<GenericDecimal<T, P>> for i128
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for i16
impl<T, P> TryFrom<GenericDecimal<T, P>> for i16
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for i32
impl<T, P> TryFrom<GenericDecimal<T, P>> for i32
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for i64
impl<T, P> TryFrom<GenericDecimal<T, P>> for i64
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for i8
impl<T, P> TryFrom<GenericDecimal<T, P>> for i8
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for isize
impl<T, P> TryFrom<GenericDecimal<T, P>> for isize
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for u128
impl<T, P> TryFrom<GenericDecimal<T, P>> for u128
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for u16
impl<T, P> TryFrom<GenericDecimal<T, P>> for u16
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for u32
impl<T, P> TryFrom<GenericDecimal<T, P>> for u32
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for u64
impl<T, P> TryFrom<GenericDecimal<T, P>> for u64
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for u8
impl<T, P> TryFrom<GenericDecimal<T, P>> for u8
source§impl<T, P> TryFrom<GenericDecimal<T, P>> for usize
impl<T, P> TryFrom<GenericDecimal<T, P>> for usize
source§impl<T, F, P1, P2> TryToConvertFrom<GenericDecimal<F, P1>> for GenericDecimal<T, P2>
impl<T, F, P1, P2> TryToConvertFrom<GenericDecimal<F, P1>> for GenericDecimal<T, P2>
fn try_to_convert_from(src: GenericDecimal<F, P1>) -> Option<Self>
source§impl<T, P> Zero for GenericDecimal<T, P>
impl<T, P> Zero for GenericDecimal<T, P>
impl<T, P> Copy for GenericDecimal<T, P>
impl<T, P> Eq for GenericDecimal<T, P>
Auto Trait Implementations§
impl<T, P> Freeze for GenericDecimal<T, P>
impl<T, P> RefUnwindSafe for GenericDecimal<T, P>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> Send for GenericDecimal<T, P>
impl<T, P> Sync for GenericDecimal<T, P>
impl<T, P> Unpin for GenericDecimal<T, P>
impl<T, P> UnwindSafe for GenericDecimal<T, P>where
P: UnwindSafe,
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)