[][src]Struct ramp::int::Int

pub struct Int { /* fields omitted */ }

An arbitrary-precision signed integer.

This type grows to the size it needs to in order to store the result of any operation.

Creation

An Int can be constructed in a number of ways:

Output

Int supports all the formatting traits, allowing it to be used just like a regular integer when used in format! and similar macros. Int also supports conversion to primitive integer types, truncating if the Int cannot fit into the target type. Conversion to primtive integers is done with the From trait:

let big_i   = Int::from(123456789);
let i = i32::from(&big_i);
assert_eq!(123456789, i);

Usage

Int has a number of operator overloads to make working with them as painless as possible.

The most basic usage is simply a + b or similar. Assuming a and b are of type Int, this operation will consume both operands, reusing the storage from one of them. If you do not wish your operands to be moved, one or both of them can be references: &a + &b works as well, but requires an entire new Int to be allocated for the return value.

There are also a overloads for a small number of primitive integer types, namely i32 and usize. While automatic type widening isn't done in Rust in general, many operations are much more efficient when working with a single integer. This means you can do a + 1 knowing that it will be performed as efficiently as possible. Comparison with these integer types is also possible, allowing checks for small constant values to be done easily:

let big_i   = Int::from(123456789);
assert!(big_i == 123456789);

Semantics

Addition, subtraction and multiplication follow the expected rules for integers. Division of two integers, N / D is defined as producing two values: a quotient, Q, and a remainder, R, such that the following equation holds: N = Q*D + R. The division operator itself returns Q while the remainder/modulo operator returns R. The sign of R is the same as the sign of Q.

The "bit-shift" operations are defined as being multiplication and division by a power-of-two for shift-left and shift-right respectively. The sign of the number is unaffected.

The remaining bitwise operands act as if the numbers are stored in two's complement format and as if the two inputs have the same number of bits.

Implementations

impl Int[src]

pub fn zero() -> Int[src]

Creates the Int that represents zero.

pub fn one() -> Int[src]

Creates the Int that represents one.

pub fn from_single_limb(limb: Limb) -> Int[src]

Creates an Int from a single Limb

pub fn sign(&self) -> i32[src]

Returns the sign of this Int as either -1, 0 or 1 depending on whether it is negative, zero, or positive, respectively.

pub fn abs(self) -> Int[src]

Consumes this Int and returns its absolute value.

pub fn to_single_limb(&self) -> Limb[src]

Returns the least-significant Limb of this Int.

pub fn abs_cmp(&self, other: &Int) -> Ordering[src]

Compares the absolute value of this Int with the absolute value of another.

pub fn abs_eq(&self, other: &Int) -> bool[src]

Returns whether this Int has the same absolute value as another.

pub fn abs_hash<H>(&self, state: &mut H) where
    H: Hasher
[src]

Hashes the value without including the sign.

This is useful for when the sign is handled elsewhere and making a copy just to change the sign is wasteful.

pub fn shrink_to_fit(&mut self)[src]

Shrinks the allocated data for this Int, attempting to remove excess capacity.

pub fn to_str_radix(&self, base: u8, upper: bool) -> String[src]

Creates a string containing the value of this Int in base base.

For bases greater than ten, if upper is true, upper-case letters are used; otherwise, lower-case letters are used.

Panics

Panics if base is less than two or greater than 36.

pub fn write_radix<W: Write>(
    &self,
    w: &mut W,
    base: u8,
    upper: bool
) -> Result<()>
[src]

Similar to to_str_radix, writing to something that implements io::Write instead.

pub fn from_str_radix(src: &str, base: u8) -> Result<Int, ParseIntError>[src]

Creates a new Int from the given string in base base.

pub fn divmod(&self, other: &Int) -> (Int, Int)[src]

Divides this Int by other, returning the quotient q and the remainder r as (q, r).

This satisfies self = q * other + r, ensuring that q and r have the same sign.

Panics

Panics if other is zero.

pub fn pow(&self, exp: usize) -> Int[src]

Raises this Int to the power of exp. 0^0 = 1.

pub fn pow_mod(&self, exp: &Int, modulus: &Int) -> Int[src]

Raises this Int to the power exp, all modulo modulus. 0^0 mod m = 1 mod m

Panics

Panics if exp is negative or modulus is zero.

pub fn square(&self) -> Int[src]

Squares this Int.

pub fn dsquare(self) -> Int[src]

Consumes this Int and returns its square.

TODO: Is there a more idiomatic way of doing this?

pub fn sqrt_rem(self) -> Option<(Int, Int)>[src]

Computes the nearest square root s of this number and its remainder r as Some((s, r)), or None if this Int is negative.

s and r are both positive and satisfy self = s * s + r.

pub fn negate(&mut self)[src]

Negates this Int in place.

pub fn is_even(&self) -> bool[src]

Returns whether this Int is even.

pub fn trailing_zeros(&self) -> u32[src]

Returns the number of trailing zero bits for this Int, or zero if this Int is zero.

pub fn count_ones(&self) -> usize[src]

Returns the number of trailing one bits (i.e. the population count) for this Int

If this number is negative, it has infinitely many ones (in two's complement). Therefore, this method returns usize::MAX for negative numbers.

pub fn bit_length(&self) -> u32[src]

Returns the number of bits required to represent the absolute value of this Int, i.e., floor(log2(abs(self))) + 1.

Returns one if this number is zero.

pub fn bit(&self, bit: u32) -> bool[src]

Returns the value of the bitth bit in this Int, as if it were represented in two's complement.

pub fn set_bit(&mut self, bit: u32, bit_val: bool)[src]

Sets the bitth bit of this number to bit_val, treating negative numbers as if they're stored in two's complement.

pub fn gcd(&self, other: &Int) -> Int[src]

Computes the greates common divisor (GCD) of this Int and other.

The result is always positive.

pub fn lcm(&self, other: &Int) -> Int[src]

Computes the lowest common multiple (LCM) of this Int and other.

pub fn to_f64(&self) -> f64[src]

Converts this Int into an f64.

This is not an exact conversion, because this Int may be more precise than an f64 can account for.

Trait Implementations

impl<'a> Add<&'a Int> for Int[src]

type Output = Int

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'a Int> for &'b Int[src]

type Output = Int

The resulting type after applying the + operator.

impl<'a> Add<&'a Int> for i32[src]

type Output = Int

The resulting type after applying the + operator.

impl<'a> Add<&'a Int> for usize[src]

type Output = Int

The resulting type after applying the + operator.

impl<'a> Add<&'a Int> for BaseInt[src]

type Output = Int

The resulting type after applying the + operator.

impl<'a> Add<&'a Int> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'a Int> for &'b Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl<'a> Add<&'a Rational> for Int[src]

type Output = Rational

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'a Rational> for &'b Int[src]

type Output = Rational

The resulting type after applying the + operator.

impl<'a> Add<Int> for &'a Int[src]

type Output = Int

The resulting type after applying the + operator.

impl Add<Int> for Int[src]

type Output = Int

The resulting type after applying the + operator.

impl Add<Int> for i32[src]

type Output = Int

The resulting type after applying the + operator.

impl Add<Int> for usize[src]

type Output = Int

The resulting type after applying the + operator.

impl Add<Int> for BaseInt[src]

type Output = Int

The resulting type after applying the + operator.

impl Add<Int> for Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl<'a> Add<Int> for &'a Rational[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<Limb> for Int[src]

type Output = Int

The resulting type after applying the + operator.

impl Add<Rational> for Int[src]

type Output = Rational

The resulting type after applying the + operator.

impl<'a> Add<Rational> for &'a Int[src]

type Output = Rational

The resulting type after applying the + operator.

impl Add<i32> for Int[src]

type Output = Int

The resulting type after applying the + operator.

impl<'a> Add<i32> for &'a Int[src]

type Output = Int

The resulting type after applying the + operator.

impl Add<u32> for Int[src]

type Output = Int

The resulting type after applying the + operator.

impl<'a> Add<u32> for &'a Int[src]

type Output = Int

The resulting type after applying the + operator.

impl Add<usize> for Int[src]

type Output = Int

The resulting type after applying the + operator.

impl<'a> Add<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the + operator.

impl<'a> AddAssign<&'a Int> for Int[src]

impl<'a> AddAssign<&'a Int> for Rational[src]

impl AddAssign<Int> for Int[src]

impl AddAssign<Int> for Rational[src]

impl AddAssign<Limb> for Int[src]

impl AddAssign<i32> for Int[src]

impl AddAssign<u32> for Int[src]

impl AddAssign<usize> for Int[src]

impl Binary for Int[src]

impl<'a> BitAnd<&'a Int> for Int[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a, 'b> BitAnd<&'a Int> for &'b Int[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a> BitAnd<&'a Int> for i32[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a> BitAnd<&'a Int> for usize[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a> BitAnd<&'a Int> for BaseInt[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a> BitAnd<Int> for &'a Int[src]

type Output = Int

The resulting type after applying the & operator.

impl BitAnd<Int> for Int[src]

type Output = Int

The resulting type after applying the & operator.

impl BitAnd<Int> for i32[src]

type Output = Int

The resulting type after applying the & operator.

impl BitAnd<Int> for usize[src]

type Output = Int

The resulting type after applying the & operator.

impl BitAnd<Int> for BaseInt[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a> BitAnd<Limb> for Int[src]

type Output = Int

The resulting type after applying the & operator.

impl BitAnd<i32> for Int[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a> BitAnd<i32> for &'a Int[src]

type Output = Int

The resulting type after applying the & operator.

impl BitAnd<u32> for Int[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a> BitAnd<u32> for &'a Int[src]

type Output = Int

The resulting type after applying the & operator.

impl BitAnd<usize> for Int[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a> BitAnd<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the & operator.

impl<'a> BitAndAssign<&'a Int> for Int[src]

impl BitAndAssign<Int> for Int[src]

impl BitAndAssign<Limb> for Int[src]

impl BitAndAssign<i32> for Int[src]

impl BitAndAssign<u32> for Int[src]

impl BitAndAssign<usize> for Int[src]

impl<'a> BitOr<&'a Int> for Int[src]

type Output = Int

The resulting type after applying the | operator.

impl<'a, 'b> BitOr<&'a Int> for &'b Int[src]

type Output = Int

The resulting type after applying the | operator.

impl<'a> BitOr<&'a Int> for i32[src]

type Output = Int

The resulting type after applying the | operator.

impl<'a> BitOr<&'a Int> for usize[src]

type Output = Int

The resulting type after applying the | operator.

impl<'a> BitOr<&'a Int> for BaseInt[src]

type Output = Int

The resulting type after applying the | operator.

impl<'a> BitOr<Int> for &'a Int[src]

type Output = Int

The resulting type after applying the | operator.

impl BitOr<Int> for Int[src]

type Output = Int

The resulting type after applying the | operator.

impl BitOr<Int> for i32[src]

type Output = Int

The resulting type after applying the | operator.

impl BitOr<Int> for usize[src]

type Output = Int

The resulting type after applying the | operator.

impl BitOr<Int> for BaseInt[src]

type Output = Int

The resulting type after applying the | operator.

impl BitOr<Limb> for Int[src]

type Output = Int

The resulting type after applying the | operator.

impl BitOr<i32> for Int[src]

type Output = Int

The resulting type after applying the | operator.

impl<'a> BitOr<i32> for &'a Int[src]

type Output = Int

The resulting type after applying the | operator.

impl BitOr<u32> for Int[src]

type Output = Int

The resulting type after applying the | operator.

impl<'a> BitOr<u32> for &'a Int[src]

type Output = Int

The resulting type after applying the | operator.

impl BitOr<usize> for Int[src]

type Output = Int

The resulting type after applying the | operator.

impl<'a> BitOr<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the | operator.

impl<'a> BitOrAssign<&'a Int> for Int[src]

impl BitOrAssign<Int> for Int[src]

impl BitOrAssign<Limb> for Int[src]

impl BitOrAssign<i32> for Int[src]

impl BitOrAssign<u32> for Int[src]

impl BitOrAssign<usize> for Int[src]

impl<'a> BitXor<&'a Int> for Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a, 'b> BitXor<&'a Int> for &'b Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a> BitXor<&'a Int> for i32[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a> BitXor<&'a Int> for usize[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a> BitXor<&'a Int> for BaseInt[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a> BitXor<Int> for &'a Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl BitXor<Int> for Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl BitXor<Int> for i32[src]

type Output = Int

The resulting type after applying the ^ operator.

impl BitXor<Int> for usize[src]

type Output = Int

The resulting type after applying the ^ operator.

impl BitXor<Int> for BaseInt[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a> BitXor<Limb> for Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl BitXor<i32> for Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a> BitXor<i32> for &'a Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl BitXor<u32> for Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a> BitXor<u32> for &'a Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl BitXor<usize> for Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a> BitXor<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl<'a> BitXorAssign<&'a Int> for Int[src]

impl BitXorAssign<Int> for Int[src]

impl BitXorAssign<Limb> for Int[src]

impl BitXorAssign<i32> for Int[src]

impl BitXorAssign<u32> for Int[src]

impl BitXorAssign<usize> for Int[src]

impl Clone for Int[src]

impl Debug for Int[src]

impl Default for Int[src]

impl Display for Int[src]

impl<'a, 'b> Div<&'a Int> for &'b Int[src]

type Output = Int

The resulting type after applying the / operator.

impl<'a> Div<&'a Int> for Int[src]

type Output = Int

The resulting type after applying the / operator.

impl<'a> Div<&'a Int> for i32[src]

type Output = Int

The resulting type after applying the / operator.

impl<'a> Div<&'a Int> for usize[src]

type Output = Int

The resulting type after applying the / operator.

impl<'a> Div<&'a Int> for BaseInt[src]

type Output = Int

The resulting type after applying the / operator.

impl<'a> Div<&'a Int> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl<'a, 'b> Div<&'a Int> for &'b Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl<'a> Div<&'a Rational> for Int[src]

type Output = Rational

The resulting type after applying the / operator.

impl<'a, 'b> Div<&'a Rational> for &'b Int[src]

type Output = Rational

The resulting type after applying the / operator.

impl<'a> Div<Int> for &'a Int[src]

type Output = Int

The resulting type after applying the / operator.

impl Div<Int> for Int[src]

type Output = Int

The resulting type after applying the / operator.

impl Div<Int> for i32[src]

type Output = Int

The resulting type after applying the / operator.

impl Div<Int> for usize[src]

type Output = Int

The resulting type after applying the / operator.

impl Div<Int> for BaseInt[src]

type Output = Int

The resulting type after applying the / operator.

impl Div<Int> for Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl<'a> Div<Int> for &'a Rational[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<Limb> for Int[src]

type Output = Int

The resulting type after applying the / operator.

impl Div<Rational> for Int[src]

type Output = Rational

The resulting type after applying the / operator.

impl<'a> Div<Rational> for &'a Int[src]

type Output = Rational

The resulting type after applying the / operator.

impl Div<i32> for Int[src]

type Output = Int

The resulting type after applying the / operator.

impl<'a> Div<i32> for &'a Int[src]

type Output = Int

The resulting type after applying the / operator.

impl Div<u32> for Int[src]

type Output = Int

The resulting type after applying the / operator.

impl<'a> Div<u32> for &'a Int[src]

type Output = Int

The resulting type after applying the / operator.

impl Div<usize> for Int[src]

type Output = Int

The resulting type after applying the / operator.

impl<'a> Div<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the / operator.

impl<'a> DivAssign<&'a Int> for Int[src]

impl<'a> DivAssign<&'a Int> for Rational[src]

impl DivAssign<Int> for Int[src]

impl DivAssign<Int> for Rational[src]

impl DivAssign<Limb> for Int[src]

impl DivAssign<i32> for Int[src]

impl DivAssign<u32> for Int[src]

impl DivAssign<usize> for Int[src]

impl<'a, 'b> DivRem<&'a Int> for &'b Int[src]

type Output = (Int, Int)

impl DivRem<Limb> for Int[src]

type Output = (Int, Limb)

impl DivRem<i32> for Int[src]

type Output = (Int, i32)

impl DivRem<u32> for Int[src]

type Output = (Int, BaseInt)

impl DivRem<usize> for Int[src]

type Output = (Int, usize)

impl Drop for Int[src]

impl Eq for Int[src]

impl<'a> From<&'a Int> for i8[src]

impl<'a> From<&'a Int> for i16[src]

impl<'a> From<&'a Int> for u128[src]

impl<'a> From<&'a Int> for usize[src]

impl<'a> From<&'a Int> for i32[src]

impl<'a> From<&'a Int> for i64[src]

impl<'a> From<&'a Int> for i128[src]

impl<'a> From<&'a Int> for isize[src]

impl<'a> From<&'a Int> for u8[src]

impl<'a> From<&'a Int> for u16[src]

impl<'a> From<&'a Int> for u32[src]

impl<'a> From<&'a Int> for u64[src]

impl From<i128> for Int[src]

impl From<i16> for Int[src]

impl From<i32> for Int[src]

impl From<i64> for Int[src]

impl From<i8> for Int[src]

impl From<isize> for Int[src]

impl From<u128> for Int[src]

impl From<u16> for Int[src]

impl From<u32> for Int[src]

impl From<u64> for Int[src]

impl From<u8> for Int[src]

impl From<usize> for Int[src]

impl FromStr for Int[src]

type Err = ParseIntError

The associated error which can be returned from parsing.

impl Hash for Int[src]

impl Integer for Int[src]

impl LowerHex for Int[src]

impl<'a, 'b> Mul<&'a Int> for &'b Int[src]

type Output = Int

The resulting type after applying the * operator.

impl<'a> Mul<&'a Int> for Int[src]

type Output = Int

The resulting type after applying the * operator.

impl<'a> Mul<&'a Int> for i32[src]

type Output = Int

The resulting type after applying the * operator.

impl<'a> Mul<&'a Int> for usize[src]

type Output = Int

The resulting type after applying the * operator.

impl<'a> Mul<&'a Int> for BaseInt[src]

type Output = Int

The resulting type after applying the * operator.

impl<'a> Mul<&'a Int> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'a Int> for &'b Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl<'a> Mul<&'a Rational> for Int[src]

type Output = Rational

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'a Rational> for &'b Int[src]

type Output = Rational

The resulting type after applying the * operator.

impl<'a> Mul<Int> for &'a Int[src]

type Output = Int

The resulting type after applying the * operator.

impl Mul<Int> for Int[src]

type Output = Int

The resulting type after applying the * operator.

impl Mul<Int> for i32[src]

type Output = Int

The resulting type after applying the * operator.

impl Mul<Int> for usize[src]

type Output = Int

The resulting type after applying the * operator.

impl Mul<Int> for BaseInt[src]

type Output = Int

The resulting type after applying the * operator.

impl Mul<Int> for Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl<'a> Mul<Int> for &'a Rational[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<Limb> for Int[src]

type Output = Int

The resulting type after applying the * operator.

impl Mul<Rational> for Int[src]

type Output = Rational

The resulting type after applying the * operator.

impl<'a> Mul<Rational> for &'a Int[src]

type Output = Rational

The resulting type after applying the * operator.

impl Mul<i32> for Int[src]

type Output = Int

The resulting type after applying the * operator.

impl<'a> Mul<i32> for &'a Int[src]

type Output = Int

The resulting type after applying the * operator.

impl Mul<u32> for Int[src]

type Output = Int

The resulting type after applying the * operator.

impl<'a> Mul<u32> for &'a Int[src]

type Output = Int

The resulting type after applying the * operator.

impl Mul<usize> for Int[src]

type Output = Int

The resulting type after applying the * operator.

impl<'a> Mul<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the * operator.

impl<'a> MulAssign<&'a Int> for Int[src]

impl<'a> MulAssign<&'a Int> for Rational[src]

impl MulAssign<Int> for Int[src]

impl MulAssign<Int> for Rational[src]

impl MulAssign<Limb> for Int[src]

impl MulAssign<i32> for Int[src]

impl MulAssign<u32> for Int[src]

impl MulAssign<usize> for Int[src]

impl Neg for Int[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a> Neg for &'a Int[src]

type Output = Int

The resulting type after applying the - operator.

impl Num for Int[src]

type FromStrRadixErr = ParseIntError

impl Octal for Int[src]

impl One for Int[src]

impl Ord for Int[src]

impl PartialEq<Int> for Int[src]

impl PartialEq<Int> for Limb[src]

impl PartialEq<Int> for i32[src]

impl PartialEq<Int> for usize[src]

impl PartialEq<Int> for u64[src]

impl PartialEq<Int> for i64[src]

impl PartialEq<Int> for Rational[src]

impl PartialEq<Limb> for Int[src]

impl PartialEq<Rational> for Int[src]

impl PartialEq<i32> for Int[src]

impl PartialEq<i64> for Int[src]

impl PartialEq<u64> for Int[src]

impl PartialEq<usize> for Int[src]

impl PartialOrd<Int> for Int[src]

impl PartialOrd<Int> for Limb[src]

impl PartialOrd<Int> for i32[src]

impl PartialOrd<Int> for usize[src]

impl PartialOrd<Int> for u64[src]

impl PartialOrd<Int> for i64[src]

impl PartialOrd<Int> for Rational[src]

impl PartialOrd<Limb> for Int[src]

impl PartialOrd<Rational> for Int[src]

impl PartialOrd<i32> for Int[src]

impl PartialOrd<i64> for Int[src]

impl PartialOrd<u64> for Int[src]

impl PartialOrd<usize> for Int[src]

impl<'a, 'b> Rem<&'a Int> for &'b Int[src]

type Output = Int

The resulting type after applying the % operator.

impl<'a> Rem<&'a Int> for Int[src]

type Output = Int

The resulting type after applying the % operator.

impl<'a> Rem<&'a Int> for i32[src]

type Output = Int

The resulting type after applying the % operator.

impl<'a> Rem<&'a Int> for usize[src]

type Output = Int

The resulting type after applying the % operator.

impl<'a> Rem<&'a Int> for BaseInt[src]

type Output = Int

The resulting type after applying the % operator.

impl<'a> Rem<Int> for &'a Int[src]

type Output = Int

The resulting type after applying the % operator.

impl Rem<Int> for Int[src]

type Output = Int

The resulting type after applying the % operator.

impl Rem<Int> for i32[src]

type Output = Int

The resulting type after applying the % operator.

impl Rem<Int> for usize[src]

type Output = Int

The resulting type after applying the % operator.

impl Rem<Int> for BaseInt[src]

type Output = Int

The resulting type after applying the % operator.

impl Rem<Limb> for Int[src]

type Output = Int

The resulting type after applying the % operator.

impl Rem<i32> for Int[src]

type Output = Int

The resulting type after applying the % operator.

impl<'a> Rem<i32> for &'a Int[src]

type Output = Int

The resulting type after applying the % operator.

impl Rem<u32> for Int[src]

type Output = Int

The resulting type after applying the % operator.

impl<'a> Rem<u32> for &'a Int[src]

type Output = Int

The resulting type after applying the % operator.

impl Rem<usize> for Int[src]

type Output = Int

The resulting type after applying the % operator.

impl<'a> Rem<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the % operator.

impl<'a> RemAssign<&'a Int> for Int[src]

impl RemAssign<Int> for Int[src]

impl RemAssign<Limb> for Int[src]

impl RemAssign<i32> for Int[src]

impl RemAssign<u32> for Int[src]

impl RemAssign<usize> for Int[src]

impl<'a> Shl<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the << operator.

impl Shl<usize> for Int[src]

type Output = Int

The resulting type after applying the << operator.

impl ShlAssign<usize> for Int[src]

impl<'a> Shr<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the >> operator.

impl Shr<usize> for Int[src]

type Output = Int

The resulting type after applying the >> operator.

impl ShrAssign<usize> for Int[src]

impl Step for Int[src]

impl<'a> Sub<&'a Int> for Int[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'a Int> for &'b Int[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a> Sub<&'a Int> for i32[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a> Sub<&'a Int> for usize[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a> Sub<&'a Int> for BaseInt[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a> Sub<Int> for &'a Int[src]

type Output = Int

The resulting type after applying the - operator.

impl Sub<Int> for Int[src]

type Output = Int

The resulting type after applying the - operator.

impl Sub<Int> for i32[src]

type Output = Int

The resulting type after applying the - operator.

impl Sub<Int> for usize[src]

type Output = Int

The resulting type after applying the - operator.

impl Sub<Int> for BaseInt[src]

type Output = Int

The resulting type after applying the - operator.

impl Sub<Limb> for Int[src]

type Output = Int

The resulting type after applying the - operator.

impl Sub<i32> for Int[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a> Sub<i32> for &'a Int[src]

type Output = Int

The resulting type after applying the - operator.

impl Sub<u32> for Int[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a> Sub<u32> for &'a Int[src]

type Output = Int

The resulting type after applying the - operator.

impl Sub<usize> for Int[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a> Sub<usize> for &'a Int[src]

type Output = Int

The resulting type after applying the - operator.

impl<'a> SubAssign<&'a Int> for Int[src]

impl SubAssign<Int> for Int[src]

impl SubAssign<Limb> for Int[src]

impl SubAssign<i32> for Int[src]

impl SubAssign<u32> for Int[src]

impl SubAssign<usize> for Int[src]

impl UpperHex for Int[src]

impl Zero for Int[src]

Auto Trait Implementations

impl RefUnwindSafe for Int

impl Send for Int

impl Sync for Int

impl Unpin for Int

impl UnwindSafe for Int

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<I> Average for I where
    I: Integer + Shr<usize, Output = I>,
    &'a I: for<'b, 'a> BitAnd<&'b I>,
    &'a I: for<'b, 'a> BitOr<&'b I>,
    &'a I: for<'b, 'a> BitXor<&'b I>,
    <&'a I as BitAnd<&'b I>>::Output == I,
    <&'a I as BitOr<&'b I>>::Output == I,
    <&'a I as BitXor<&'b I>>::Output == I, 
[src]

fn average_floor(&self, other: &I) -> I[src]

Returns the floor value of the average of self and other.

fn average_ceil(&self, other: &I) -> I[src]

Returns the ceil value of the average of self and other.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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

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

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

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>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.