pub struct Integer {
pub val: Integer,
}Fields§
§val: IntegerTrait Implementations§
Source§impl<'a> AddAssign<&'a Integer> for Integer
impl<'a> AddAssign<&'a Integer> for Integer
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
Performs the
+= operation. Read moreSource§impl<B> AddAssign<B> for Integer
impl<B> AddAssign<B> for Integer
Source§fn add_assign(&mut self, rhs: B)
fn add_assign(&mut self, rhs: B)
Performs the
+= operation. Read moreSource§impl AddAssign for Integer
impl AddAssign for Integer
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl ArchimedeanDiv for Integer
impl ArchimedeanDiv for Integer
Source§fn embed_nat<N: Natural>(n: N) -> Self
fn embed_nat<N: Natural>(n: N) -> Self
Maps a natural number into this structure preserving addition and
using the relevant canonical representation Read more
Source§fn div_arch(self, rhs: Self) -> Self
fn div_arch(self, rhs: Self) -> Self
the unique integer
n such that n*rhs <= self and (n+1)*rhs > selfSource§fn rem_arch(self, rhs: Self) -> Self
fn rem_arch(self, rhs: Self) -> Self
the remaining difference after dividing by rhs (ie.
self - self.div_arch(rhs)*rhs)Source§fn div_alg_arch(self, rhs: Self) -> (Self, Self)
fn div_alg_arch(self, rhs: Self) -> (Self, Self)
Source§impl Bezout for Integer
impl Bezout for Integer
Source§fn bezout_with_gcd(self, rhs: Self) -> (Self, Self, Self)
fn bezout_with_gcd(self, rhs: Self) -> (Self, Self, Self)
Computes the GCD and the bezout coefficients
in one function call
Source§fn bezout_coefficients(self, rhs: Self) -> (Self, Self)
fn bezout_coefficients(self, rhs: Self) -> (Self, Self)
Bezout coefficients of a pair of elements Read more
Source§impl CheckedAdd for Integer
impl CheckedAdd for Integer
Source§fn checked_add(&self, v: &Self) -> Option<Self>
fn checked_add(&self, v: &Self) -> Option<Self>
Adds two numbers, checking for overflow. If overflow happens,
None is
returned.Source§impl CheckedDiv for Integer
impl CheckedDiv for Integer
Source§fn checked_div(&self, v: &Self) -> Option<Self>
fn checked_div(&self, v: &Self) -> Option<Self>
Divides two numbers, checking for underflow, overflow and division by
zero. If any of that happens,
None is returned.Source§impl CheckedMul for Integer
impl CheckedMul for Integer
Source§fn checked_mul(&self, v: &Self) -> Option<Self>
fn checked_mul(&self, v: &Self) -> Option<Self>
Multiplies two numbers, checking for underflow or overflow. If underflow
or overflow happens,
None is returned.Source§impl CheckedNeg for Integer
impl CheckedNeg for Integer
Source§fn checked_neg(&self) -> Option<Self>
fn checked_neg(&self) -> Option<Self>
Negates a number, returning
None for results that can’t be represented, like signed MIN
values that can’t be positive, or non-zero unsigned values that can’t be negative. Read moreSource§impl CheckedRem for Integer
impl CheckedRem for Integer
Source§fn checked_rem(&self, v: &Self) -> Option<Self>
fn checked_rem(&self, v: &Self) -> Option<Self>
Finds the remainder of dividing two numbers, checking for underflow, overflow and division
by zero. If any of that happens,
None is returned. Read moreSource§impl CheckedShl for Integer
impl CheckedShl for Integer
Source§impl CheckedShr for Integer
impl CheckedShr for Integer
Source§impl CheckedSub for Integer
impl CheckedSub for Integer
Source§fn checked_sub(&self, v: &Self) -> Option<Self>
fn checked_sub(&self, v: &Self) -> Option<Self>
Subtracts two numbers, checking for underflow. If underflow happens,
None is returned.Source§impl ComplexSubset for Integer
impl ComplexSubset for Integer
type Real = Float
type Natural = Integer
type Integer = Integer
Source§fn as_real(self) -> Self::Real
fn as_real(self) -> Self::Real
Converts
self to a real number, discarding any imaginary component, if complex.Source§fn as_natural(self) -> Self::Natural
fn as_natural(self) -> Self::Natural
Converts
self to a natural number, truncating when necessary.Source§fn as_integer(self) -> Self::Integer
fn as_integer(self) -> Self::Integer
Converts
self to an integer, truncating when necessary.Source§fn floor(self) -> Self
fn floor(self) -> Self
Rounds the real and imaginary components of
self to the closest integer downwardSource§fn ceil(self) -> Self
fn ceil(self) -> Self
Rounds the real and imaginary components of
self to the closest integer upwardSource§fn round(self) -> Self
fn round(self) -> Self
Rounds the real and imaginary components of
self to the closest integerSource§fn trunc(self) -> Self
fn trunc(self) -> Self
Rounds the real and imaginary components of
self by removing the factional partsSource§fn fract(self) -> Self
fn fract(self) -> Self
Removes the integral parts of the real and imaginary components of
selfSource§fn modulus_sqrd(self) -> Self
fn modulus_sqrd(self) -> Self
The square of the complex absolute value of
self Read moreSource§impl<'a> DivAssign<&'a Integer> for Integer
impl<'a> DivAssign<&'a Integer> for Integer
Source§fn div_assign(&mut self, rhs: &Self)
fn div_assign(&mut self, rhs: &Self)
Performs the
/= operation. Read moreSource§impl<B> DivAssign<B> for Integer
impl<B> DivAssign<B> for Integer
Source§fn div_assign(&mut self, rhs: B)
fn div_assign(&mut self, rhs: B)
Performs the
/= operation. Read moreSource§impl DivAssign for Integer
impl DivAssign for Integer
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moreSource§impl Divisibility for Integer
impl Divisibility for Integer
Source§impl EuclideanDiv for Integer
impl EuclideanDiv for Integer
Source§fn euclid_norm(&self) -> Self::Naturals
fn euclid_norm(&self) -> Self::Naturals
A measure of the “degree” of a given element. Read more
Source§fn div_euc(self, rhs: Self) -> Self
fn div_euc(self, rhs: Self) -> Self
The quotient from Euclidean division
Source§fn rem_euc(self, rhs: Self) -> Self
fn rem_euc(self, rhs: Self) -> Self
The remainder from the Euclidean division
Source§impl FromPrimitive for Integer
impl FromPrimitive for Integer
Source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
Converts an
i64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
Converts an
u64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
Converts an
isize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
Converts an
i8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
Converts an
i16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
Converts an
i32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
Converts an
i128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
Converts a
usize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
Converts an
u8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
Converts an
u16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
Converts an
u32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
Converts an
u128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§impl IntegerSubset for Integer
impl IntegerSubset for Integer
Source§fn as_unsigned(self) -> Self::Unsigned
fn as_unsigned(self) -> Self::Unsigned
Converts
self into an unsigned integer representation Read moreSource§fn abs_unsigned(self) -> Self::Unsigned
fn abs_unsigned(self) -> Self::Unsigned
Takes the absolute value and converts into an unsigned integer representation Read more
Source§impl<'a> MulAssign<&'a Integer> for Integer
impl<'a> MulAssign<&'a Integer> for Integer
Source§fn mul_assign(&mut self, rhs: &Self)
fn mul_assign(&mut self, rhs: &Self)
Performs the
*= operation. Read moreSource§impl<B> MulAssign<B> for Integer
impl<B> MulAssign<B> for Integer
Source§fn mul_assign(&mut self, rhs: B)
fn mul_assign(&mut self, rhs: B)
Performs the
*= operation. Read moreSource§impl MulAssign for Integer
impl MulAssign for Integer
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl Ord for Integer
impl Ord for Integer
Source§impl PartialOrd for Integer
impl PartialOrd for Integer
Source§impl<'a> RemAssign<&'a Integer> for Integer
impl<'a> RemAssign<&'a Integer> for Integer
Source§fn rem_assign(&mut self, rhs: &Self)
fn rem_assign(&mut self, rhs: &Self)
Performs the
%= operation. Read moreSource§impl<B> RemAssign<B> for Integer
impl<B> RemAssign<B> for Integer
Source§fn rem_assign(&mut self, rhs: B)
fn rem_assign(&mut self, rhs: B)
Performs the
%= operation. Read moreSource§impl RemAssign for Integer
impl RemAssign for Integer
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%= operation. Read moreSource§impl<B> ShlAssign<B> for Integer
impl<B> ShlAssign<B> for Integer
Source§fn shl_assign(&mut self, rhs: B)
fn shl_assign(&mut self, rhs: B)
Performs the
<<= operation. Read moreSource§impl<B> ShrAssign<B> for Integer
impl<B> ShrAssign<B> for Integer
Source§fn shr_assign(&mut self, rhs: B)
fn shr_assign(&mut self, rhs: B)
Performs the
>>= operation. Read moreSource§impl<'a> SubAssign<&'a Integer> for Integer
impl<'a> SubAssign<&'a Integer> for Integer
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
Performs the
-= operation. Read moreSource§impl<B> SubAssign<B> for Integer
impl<B> SubAssign<B> for Integer
Source§fn sub_assign(&mut self, rhs: B)
fn sub_assign(&mut self, rhs: B)
Performs the
-= operation. Read moreSource§impl SubAssign for Integer
impl SubAssign for Integer
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl ToPrimitive for Integer
impl ToPrimitive for Integer
Source§fn to_i64(&self) -> Option<i64>
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>
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>
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>
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>
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>
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>
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 moreSource§fn to_usize(&self) -> Option<usize>
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>
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>
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>
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>
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 moreimpl AddAssociative for Integer
impl AddCommutative for Integer
impl AddOrdered for Integer
impl ArchimedeanProperty for Integer
impl Distributive for Integer
impl Eq for Integer
impl Integer for Integer
impl MulAssociative for Integer
impl MulCommutative for Integer
impl MulOrdered for Integer
impl Natural for Integer
impl NoZeroDivisors for Integer
impl StructuralPartialEq for Integer
impl UniquelyFactorizable for Integer
Auto Trait Implementations§
impl Freeze for Integer
impl RefUnwindSafe for Integer
impl Send for Integer
impl Sync for Integer
impl Unpin for Integer
impl UnwindSafe for Integer
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<G> MulN for Gwhere
G: AddSemigroup + Zero,
impl<G> MulN for Gwhere
G: AddSemigroup + Zero,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<G> PowN for Gwhere
G: MulSemigroup + One,
impl<G> PowN for Gwhere
G: MulSemigroup + One,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<G> Signed for Gwhere
G: PartialOrd + Zero,
impl<G> Signed for Gwhere
G: PartialOrd + Zero,
Source§default fn non_negative(&self) -> bool
default fn non_negative(&self) -> bool
If this element is greater than or equal to zero
Source§default fn non_positive(&self) -> bool
default fn non_positive(&self) -> bool
If this element is less than or equal to zero
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.