Enum fraction::dynaint::DynaInt

source ·
pub enum DynaInt<T, G>{
    S(T),
    __H(G),
}
Expand description

The wrapper implementation

Keeps data within S (small) whenever possible, performing checked arithmetic and moving onto __H (huge) when overflows happen. Every math operation on __H performs a read of the resulting number with TryToConvertFrom::try_to_convert_from. Every math operation on S is checked for overflows.

Variants§

§

S(T)

Represents the small type, implementing Copy and allocated on stack. The wrapper tries to reduce contained values to this type whenever possible

§

__H(G)

Represents the huge type, implementing Clone. To be used when values overflow T

Implementations§

source§

impl<T, G> DynaInt<T, G>

source

pub fn unpack(self) -> Result<T, G>

Unpacks the value

Utilises Result::Ok for S(small) numbers and Result::Err for __H(huge) ones

§Examples
use fraction::dynaint::DynaInt;
type D = DynaInt<u8, u16>;

assert_eq!(Ok(1u8), D::from(1u8).unpack());
assert_eq!(Err(256u16), D::from(256u16).unpack());

Trait Implementations§

source§

impl<'a, T, G> Add<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

type Output = DynaInt<T, G>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Self) -> Self::Output

Performs the + operation. Read more
source§

impl<'a, T, G> Add for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Add<Output = T> + CheckedAdd, G: Clone + GenericInteger + Add<Output = G> + CheckedAdd, &'a G: Add<G, Output = G> + Add<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
source§

impl<T, G> Add for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Add<Output = T> + CheckedAdd, G: Clone + GenericInteger + Add<Output = G> + CheckedAdd,

source§

type Output = DynaInt<T, G>

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
source§

impl<'a, T, G> AddAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn add_assign(&mut self, other: &'a Self)

Performs the += operation. Read more
source§

impl<T, G> AddAssign for DynaInt<T, G>

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl<'a, T, G> BitAnd for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + BitAnd<Output = T>, G: Clone + GenericInteger + BitAnd<Output = G> + BitAnd<&'a G, Output = G>, &'a G: BitAnd<G, Output = G> + BitAnd<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the & operator.
source§

fn bitand(self, other: Self) -> Self::Output

Performs the & operation. Read more
source§

impl<T, G> BitAnd for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + BitAnd<Output = T>, G: Clone + GenericInteger + BitAnd<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the & operator.
source§

fn bitand(self, other: Self) -> Self::Output

Performs the & operation. Read more
source§

impl<'a, T, G> BitAndAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn bitand_assign(&mut self, other: &'a Self)

Performs the &= operation. Read more
source§

impl<T, G> BitAndAssign for DynaInt<T, G>

source§

fn bitand_assign(&mut self, other: Self)

Performs the &= operation. Read more
source§

impl<'a, T, G> BitOr for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + BitOr<Output = T>, G: Clone + GenericInteger + BitOr<Output = G> + BitOr<&'a G, Output = G>, &'a G: BitOr<G, Output = G> + BitOr<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the | operator.
source§

fn bitor(self, other: Self) -> Self::Output

Performs the | operation. Read more
source§

impl<T, G> BitOr for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + BitOr<Output = T>, G: Clone + GenericInteger + BitOr<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the | operator.
source§

fn bitor(self, other: Self) -> Self::Output

Performs the | operation. Read more
source§

impl<'a, T, G> BitOrAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn bitor_assign(&mut self, other: &'a Self)

Performs the |= operation. Read more
source§

impl<T, G> BitOrAssign for DynaInt<T, G>

source§

fn bitor_assign(&mut self, other: Self)

Performs the |= operation. Read more
source§

impl<'a, T, G> BitXor for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + BitXor<Output = T>, G: Clone + GenericInteger + BitXor<Output = G> + BitXor<&'a G, Output = G>, &'a G: BitXor<G, Output = G> + BitXor<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, other: Self) -> Self::Output

Performs the ^ operation. Read more
source§

impl<T, G> BitXor for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + BitXor<Output = T>, G: Clone + GenericInteger + BitXor<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, other: Self) -> Self::Output

Performs the ^ operation. Read more
source§

impl<'a, T, G> BitXorAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn bitxor_assign(&mut self, other: &'a Self)

Performs the ^= operation. Read more
source§

impl<T, G> BitXorAssign for DynaInt<T, G>

source§

fn bitxor_assign(&mut self, other: Self)

Performs the ^= operation. Read more
source§

impl<T, G> Bounded for DynaInt<T, G>

source§

fn min_value() -> Self

Returns the smallest finite number this type can represent
source§

fn max_value() -> Self

Returns the largest finite number this type can represent
source§

impl<T, G> CheckedAdd for DynaInt<T, G>

source§

fn checked_add(&self, other: &Self) -> Option<Self>

Adds two numbers, checking for overflow. If overflow happens, None is returned.
source§

impl<T, G> CheckedDiv for DynaInt<T, G>

source§

fn checked_div(&self, other: &Self) -> Option<Self>

Divides two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned.
source§

impl<T, G> CheckedMul for DynaInt<T, G>

source§

fn checked_mul(&self, other: &Self) -> Option<Self>

Multiplies two numbers, checking for underflow or overflow. If underflow or overflow happens, None is returned.
source§

impl<T, G> CheckedSub for DynaInt<T, G>

source§

fn checked_sub(&self, other: &Self) -> Option<Self>

Subtracts two numbers, checking for underflow. If underflow happens, None is returned.
source§

impl<T, G> Clone for DynaInt<T, G>

source§

fn clone(&self) -> DynaInt<T, G>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, G> Debug for DynaInt<T, G>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, G> Display for DynaInt<T, G>

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T, G> Div<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

type Output = DynaInt<T, G>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Self) -> Self::Output

Performs the / operation. Read more
source§

impl<'a, T, G> Div for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Div<Output = T> + CheckedDiv, G: Clone + GenericInteger + Div<Output = G> + CheckedDiv, &'a G: Div<G, Output = G> + Div<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the / operator.
source§

fn div(self, other: Self) -> Self::Output

Performs the / operation. Read more
source§

impl<T, G> Div for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Div<Output = T> + CheckedDiv, G: Clone + GenericInteger + Div<Output = G> + CheckedDiv,

source§

type Output = DynaInt<T, G>

The resulting type after applying the / operator.
source§

fn div(self, other: Self) -> Self::Output

Performs the / operation. Read more
source§

impl<'a, T, G> DivAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn div_assign(&mut self, other: &'a Self)

Performs the /= operation. Read more
source§

impl<T, G> DivAssign for DynaInt<T, G>

source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
source§

impl<T, G> From<BigUint> for DynaInt<T, G>

source§

fn from(value: BigUint) -> DynaInt<T, G>

Converts to this type from the input type.
source§

impl<T, G> From<DynaInt<T, G>> for BigUint

source§

fn from(value: DynaInt<T, G>) -> BigUint

Converts to this type from the input type.
source§

impl<T, G> From<u128> for DynaInt<T, G>

source§

fn from(v: u128) -> DynaInt<T, G>

Converts to this type from the input type.
source§

impl<T, G> From<u16> for DynaInt<T, G>

source§

fn from(v: u16) -> DynaInt<T, G>

Converts to this type from the input type.
source§

impl<T, G> From<u32> for DynaInt<T, G>

source§

fn from(v: u32) -> DynaInt<T, G>

Converts to this type from the input type.
source§

impl<T, G> From<u64> for DynaInt<T, G>

source§

fn from(v: u64) -> DynaInt<T, G>

Converts to this type from the input type.
source§

impl<T, G> From<u8> for DynaInt<T, G>

source§

fn from(value: u8) -> DynaInt<T, G>

Converts to this type from the input type.
source§

impl<T, G> From<usize> for DynaInt<T, G>

source§

fn from(v: usize) -> DynaInt<T, G>

Converts to this type from the input type.
source§

impl<T, G> GenericInteger for DynaInt<T, G>
where T: GenericInteger + Copy + Integer + Into<G> + TryToConvertFrom<G> + From<u8>, G: Clone + GenericInteger + 'static,

source§

fn _0() -> Self

Returns value 0 of the type
source§

fn _1() -> Self

Returns value 1 of the type
source§

fn _10() -> Self

Returns value 10 of the type
source§

fn _0r() -> Option<&'static Self>

Returns Maybe of 0
source§

fn _1r() -> Option<&'static Self>

Returns Maybe of 1
source§

fn _10r() -> Option<&'static Self>

Returns Maybe of 10
source§

fn get_signed_value(self) -> (Sign, Self)

Returns the sign and the value itself. Zero values must have Sign::Plus
source§

impl<T, G> Integer for DynaInt<T, G>

source§

fn div_floor(&self, other: &Self) -> Self

Floored integer division. Read more
source§

fn mod_floor(&self, other: &Self) -> Self

Floored integer modulo, satisfying: Read more
source§

fn gcd(&self, other: &Self) -> Self

Greatest Common Divisor (GCD). Read more
source§

fn lcm(&self, other: &Self) -> Self

Lowest Common Multiple (LCM). Read more
source§

fn divides(&self, other: &Self) -> bool

👎Deprecated: Please use is_multiple_of instead
Deprecated, use is_multiple_of instead.
source§

fn is_multiple_of(&self, other: &Self) -> bool

Returns true if self is a multiple of other. Read more
source§

fn is_even(&self) -> bool

Returns true if the number is even. Read more
source§

fn is_odd(&self) -> bool

Returns true if the number is odd. Read more
source§

fn div_rem(&self, other: &Self) -> (Self, Self)

Simultaneous truncated integer division and modulus. Returns (quotient, remainder). Read more
source§

fn div_ceil(&self, other: &Self) -> Self

Ceiled integer division. Read more
source§

fn gcd_lcm(&self, other: &Self) -> (Self, Self)

Greatest Common Divisor (GCD) and Lowest Common Multiple (LCM) together. Read more
source§

fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>
where Self: Clone,

Greatest common divisor and Bézout coefficients. Read more
source§

fn div_mod_floor(&self, other: &Self) -> (Self, Self)

Simultaneous floored integer division and modulus. Returns (quotient, remainder). Read more
source§

fn next_multiple_of(&self, other: &Self) -> Self
where Self: Clone,

Rounds up to nearest multiple of argument. Read more
source§

fn prev_multiple_of(&self, other: &Self) -> Self
where Self: Clone,

Rounds down to nearest multiple of argument. Read more
source§

fn dec(&mut self)
where Self: Clone,

Decrements self by one. Read more
source§

fn inc(&mut self)
where Self: Clone,

Increments self by one. Read more
source§

impl<'a, T, G> Mul<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

type Output = DynaInt<T, G>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Self) -> Self::Output

Performs the * operation. Read more
source§

impl<'a, T, G> Mul for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Mul<Output = T> + CheckedMul, G: Clone + GenericInteger + Mul<Output = G> + CheckedMul, &'a G: Mul<G, Output = G> + Mul<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self::Output

Performs the * operation. Read more
source§

impl<T, G> Mul for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Mul<Output = T> + CheckedMul, G: Clone + GenericInteger + Mul<Output = G> + CheckedMul,

source§

type Output = DynaInt<T, G>

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self::Output

Performs the * operation. Read more
source§

impl<'a, T, G> MulAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn mul_assign(&mut self, other: &'a Self)

Performs the *= operation. Read more
source§

impl<T, G> MulAssign for DynaInt<T, G>

source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
source§

impl<T, G> Neg for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Neg<Output = T>, G: Clone + GenericInteger + Neg<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<T, G> Not for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Not<Output = T>, G: Clone + GenericInteger + Not<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl<T, G> Num for DynaInt<T, G>

source§

type FromStrRadixErr = <G as Num>::FromStrRadixErr

source§

fn from_str_radix(s: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
source§

impl<T, G> One for DynaInt<T, G>

source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
source§

impl<T, G> Ord for DynaInt<T, G>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T, G> PartialEq for DynaInt<T, G>

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, G> PartialOrd for DynaInt<T, G>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a, T, G> Rem<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

type Output = DynaInt<T, G>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Self) -> Self::Output

Performs the % operation. Read more
source§

impl<'a, T, G> Rem for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Rem<Output = T>, G: Clone + GenericInteger + Rem<Output = G>, &'a G: Rem<G, Output = G> + Rem<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the % operator.
source§

fn rem(self, other: Self) -> Self::Output

Performs the % operation. Read more
source§

impl<T, G> Rem for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Rem<Output = T>, G: Clone + GenericInteger + Rem<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the % operator.
source§

fn rem(self, other: Self) -> Self::Output

Performs the % operation. Read more
source§

impl<'a, T, G> RemAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn rem_assign(&mut self, other: &'a Self)

Performs the %= operation. Read more
source§

impl<T, G> RemAssign for DynaInt<T, G>

source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
source§

impl<'a, T, G> Shl for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Shl<Output = T>, G: Clone + GenericInteger + Shl<Output = G> + Shl<&'a G, Output = G>, &'a G: Shl<G, Output = G> + Shl<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the << operator.
source§

fn shl(self, other: Self) -> Self::Output

Performs the << operation. Read more
source§

impl<T, G> Shl for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Shl<Output = T>, G: Clone + GenericInteger + Shl<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the << operator.
source§

fn shl(self, other: Self) -> Self::Output

Performs the << operation. Read more
source§

impl<'a, T, G> ShlAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn shl_assign(&mut self, other: &'a Self)

Performs the <<= operation. Read more
source§

impl<T, G> ShlAssign for DynaInt<T, G>

source§

fn shl_assign(&mut self, other: Self)

Performs the <<= operation. Read more
source§

impl<'a, T, G> Shr for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Shr<Output = T>, G: Clone + GenericInteger + Shr<Output = G> + Shr<&'a G, Output = G>, &'a G: Shr<G, Output = G> + Shr<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the >> operator.
source§

fn shr(self, other: Self) -> Self::Output

Performs the >> operation. Read more
source§

impl<T, G> Shr for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Shr<Output = T>, G: Clone + GenericInteger + Shr<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the >> operator.
source§

fn shr(self, other: Self) -> Self::Output

Performs the >> operation. Read more
source§

impl<'a, T, G> ShrAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn shr_assign(&mut self, other: &'a Self)

Performs the >>= operation. Read more
source§

impl<T, G> ShrAssign for DynaInt<T, G>

source§

fn shr_assign(&mut self, other: Self)

Performs the >>= operation. Read more
source§

impl<'a, T, G> Sub<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

type Output = DynaInt<T, G>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Self) -> Self::Output

Performs the - operation. Read more
source§

impl<'a, T, G> Sub for &'a DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Sub<Output = T> + CheckedSub, G: Clone + GenericInteger + Sub<Output = G> + CheckedSub, &'a G: Sub<G, Output = G> + Sub<Output = G>,

source§

type Output = DynaInt<T, G>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
source§

impl<T, G> Sub for DynaInt<T, G>
where T: Copy + GenericInteger + Into<G> + TryToConvertFrom<G> + From<u8> + Sub<Output = T> + CheckedSub, G: Clone + GenericInteger + Sub<Output = G> + CheckedSub,

source§

type Output = DynaInt<T, G>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
source§

impl<'a, T, G> SubAssign<&'a DynaInt<T, G>> for DynaInt<T, G>

source§

fn sub_assign(&mut self, other: &'a Self)

Performs the -= operation. Read more
source§

impl<T, G> SubAssign for DynaInt<T, G>

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl<T, G> ToBigInt for DynaInt<T, G>

source§

fn to_bigint(&self) -> Option<BigInt>

Converts the value of self to a BigInt.
source§

impl<T, G> ToBigUint for DynaInt<T, G>

source§

fn to_biguint(&self) -> Option<BigUint>

Converts the value of self to a BigUint.
source§

impl<T, G> ToPrimitive for DynaInt<T, G>

source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
source§

fn to_f64(&self) -> Option<f64>

Converts the value of 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 more
source§

impl<T, G> Zero for DynaInt<T, G>

source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl<T, G> Copy for DynaInt<T, G>

source§

impl<T, G> Eq for DynaInt<T, G>

Auto Trait Implementations§

§

impl<T, G> Freeze for DynaInt<T, G>
where T: Freeze, G: Freeze,

§

impl<T, G> RefUnwindSafe for DynaInt<T, G>

§

impl<T, G> Send for DynaInt<T, G>
where T: Send, G: Send,

§

impl<T, G> Sync for DynaInt<T, G>
where T: Sync, G: Sync,

§

impl<T, G> Unpin for DynaInt<T, G>
where T: Unpin, G: Unpin,

§

impl<T, G> UnwindSafe for DynaInt<T, G>
where T: UnwindSafe, G: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> LowerBounded for T
where T: Bounded,

source§

fn min_value() -> T

Returns the smallest finite number this type can represent
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UpperBounded for T
where T: Bounded,

source§

fn max_value() -> T

Returns the largest finite number this type can represent
source§

impl<T> NumAssign for T
where T: Num + NumAssignOps,

source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T> NumAssignRef for T
where T: NumAssign + for<'r> NumAssignOps<&'r T>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

source§

impl<T> NumRef for T
where T: Num + for<'r> NumOps<&'r T>,

source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,