pub struct CheckedInts<E> where
    E: PrimInt + Signed + Debug + From<i8> + TryFrom<isize>, 
{ /* private fields */ }
Expand description

The set of integers whose elements are stored in a primitive signed integer type. This structure is functionally equivalent to the set of all integers, but some operations are going to panic if the mathematical result cannot be represented in the primitive type. The lattice order is the normal total order, which is not bounded.

Trait Implementations

The additive identity element of the ring.

Checks if the given element is the additive identity of the ring.

The additive inverse of the given element.

The additive sum of the given elements

The difference of the given elements.

Returns an integer multiple of the given element.

The element is changed to its additive inverse.

The second element is added to the first one.

Doubles the given element in place.

The second element is subtracted from the first one.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The type of the elements of this domain.

Checks if the given objects represent the same element of the set.

Checks if the given object is a member of the domain.

Performs the euclidean division algorithm dividing the first elem with the second one and returning the quotient and the remainder. This method panics if the second element is zero (because there is no unique solution) Read more

Returns true if the second element is zero or the first element has zero quotient by the second one. These are the representative elements of the factor ring by the principal ideal generated by the second element. Read more

Performs the division just like the quo_rem method would do and returns the quotient. This method panics if the second element is zero. Read more

Performs the division just like the quo_rem method would do and returns the remainder. This method panics if the second element is zero. Read more

Calculates the greatest common divisor of two elements using the Euclidean algorithm. Read more

Calculates the lest common divisor of the two elements.

Performs the extended Euclidean algorithm which returns the greatest common divisor, and two elements that multiplied with the inputs gives the greatest common divisor. Read more

Checks if the given two elements are relative prime.

Checks if the second element divides the first one and returns the unique quotient if it exists. This method panics if the second element is zero (because there would be no unique solution). Read more

We assume, that among all associates of the given elem there is a well defined unique one (non-negative for integers, zero or monic for polynomials). This method returns that representative element. Read more

Returns the unique invertible element which is the quotient of the associate representative and the given element. This method panics if the element is zero. Read more

Checks if the first element is a multiple of (or divisible by) the second one. Read more

Returns true if the two elements are associates (divide each other)

Returns the largest element that is less than or equal to both given elements. Read more

Returns the smallest element that is greater than or equal to both given elements. Read more

The multiplicative identity element of the ring.

Checks if the given element is the multiplicative identity.

Calculates the multiplicative inverse of the given element if it exists.

Returns true if the given element has a multiplicative inverse.

Returns true if the first element is less than or equal to the second one in the partial order. Read more

Returns true if the first element is strictly less than the second one. Read more

Returns true if one of the elements is less than or equal to the other. Read more

The multiplicative product of the given elements.

The first element is multiplied with the second one in place.

Squares the given element in place.

Returns the integer multiple of the one element in the ring.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.