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

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:

  • Int::zero and Int::one construct a zero- and one-valued Int respectively.

  • Int::from will convert from any primitive integer type to an Int of the same value

    let four = Int::from(4);
  • Int::from_str (or str::parse) will attempt to convert from a string to an Int

    let i = Int::from_str("123456789").unwrap();

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.

Methods

impl Int
[src]

[src]

[src]

[src]

Creates a new Int from the given Limb.

[src]

Returns the sign of the Int as either -1, 0 or 1 for self being negative, zero or positive, respectively.

[src]

Consumes self and returns the absolute value

[src]

Returns the least-significant limb of self.

[src]

Compare the absolute value of self to the absolute value of other, returning an Ordering with the result.

[src]

Returns the equality of the absolute values of self and other.

[src]

Hashes the value without including the sign, useful for when the sign is handled elsewhere and making a copy just to change the sign is wasteful

[src]

Try to shrink the allocated data for this Int.

[src]

Returns a string containing the value of self in base base. For bases greater than ten, if upper is true, upper-case letters are used, otherwise lower-case ones are used.

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

[src]

[src]

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

[src]

Divide self by other, returning the quotient, Q, and remainder, R as (Q, R).

With N = self, D = other, Q and R satisfy: N = QD + R. The sign of Q and R are the same.

This will panic if other is zero.

[src]

Raises self to the power of exp

[src]

Returns the square of self.

[src]

[src]

Compute the sqrt of this number, returning its floor, S, and the remainder, R, as Some((S, R)), or None if this number is negative.

The numbers S, R are both positive and satisfy self = S * S + R.

[src]

Negates self in-place

[src]

Returns whether or not this number is even.

Returns 0 if self == 0

[src]

Returns the number of trailing zero bits in this number

Returns 0 if self == 0

[src]

Returns the number of ones (the population count) in this number

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

[src]

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

Returns 1 if self == 0.

[src]

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

[src]

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

[src]

Calculates the Greatest Common Divisor (GCD) of the number and other.

The result is always positive.

[src]

Calculates the Lowest Common Multiple (LCM) of the number and other.

[src]

Trait Implementations

impl Clone for Int
[src]

[src]

Returns a copy of the value. Read more

[src]

Performs copy-assignment from source. Read more

impl Default for Int
[src]

[src]

Returns the "default value" for a type. Read more

impl Drop for Int
[src]

[src]

Executes the destructor for this type. Read more

impl PartialEq<Int> for Int
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl PartialEq<Limb> for Int
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Eq for Int
[src]

impl Ord for Int
[src]

[src]

This method returns an Ordering between self and other. Read more

[src]

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the maximum of two values. Read more

[src]

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the minimum of two values. Read more

impl PartialOrd<Int> for Int
[src]

[src]

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

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<Limb> for Int
[src]

[src]

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

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Hash for Int
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl AddAssign<Limb> for Int
[src]

[src]

Performs the += operation.

impl Add<Limb> for Int
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

[src]

Performs the += operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Add<Int> for Int
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl AddAssign<Int> for Int
[src]

[src]

Performs the += operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl SubAssign<Limb> for Int
[src]

[src]

Performs the -= operation.

impl Sub<Limb> for Int
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

[src]

Performs the -= operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Sub<Int> for Int
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl SubAssign<Int> for Int
[src]

[src]

Performs the -= operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl MulAssign<Limb> for Int
[src]

[src]

Performs the *= operation.

impl Mul<Limb> for Int
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Int> for Int
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

[src]

Performs the *= operation.

impl MulAssign<Int> for Int
[src]

[src]

Performs the *= operation.

impl DivAssign<Limb> for Int
[src]

[src]

Performs the /= operation.

impl Div<Limb> for Int
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Int> for Int
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

[src]

Performs the /= operation.

impl DivAssign<Int> for Int
[src]

[src]

Performs the /= operation.

impl Rem<Limb> for Int
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl RemAssign<Limb> for Int
[src]

[src]

Performs the %= operation.

impl DivRem<Limb> for Int
[src]

[src]

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Int> for Int
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

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

[src]

impl RemAssign<Int> for Int
[src]

[src]

Performs the %= operation.

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

[src]

Performs the %= operation.

impl Neg for Int
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

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

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl ShlAssign<usize> for Int
[src]

[src]

Performs the <<= operation.

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

The resulting type after applying the << operator.

[src]

Performs the << operation.

impl Shl<usize> for Int
[src]

The resulting type after applying the << operator.

[src]

Performs the << operation.

impl ShrAssign<usize> for Int
[src]

[src]

Performs the >>= operation.

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

The resulting type after applying the >> operator.

[src]

Performs the >> operation.

impl Shr<usize> for Int
[src]

The resulting type after applying the >> operator.

[src]

Performs the >> operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitAndAssign<Limb> for Int
[src]

[src]

Performs the &= operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitAnd<Int> for Int
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitAndAssign<Int> for Int
[src]

[src]

Performs the &= operation.

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

[src]

Performs the &= operation.

impl BitOr<Limb> for Int
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitOrAssign<Limb> for Int
[src]

[src]

Performs the |= operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitOr<Int> for Int
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitOrAssign<Int> for Int
[src]

[src]

Performs the |= operation.

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

[src]

Performs the |= operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl BitXorAssign<Limb> for Int
[src]

[src]

Performs the ^= operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl BitXor<Int> for Int
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl BitXorAssign<Int> for Int
[src]

[src]

Performs the ^= operation.

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

[src]

Performs the ^= operation.

impl Add<i32> for Int
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl AddAssign<i32> for Int
[src]

[src]

Performs the += operation.

impl Sub<i32> for Int
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl SubAssign<i32> for Int
[src]

[src]

Performs the -= operation.

impl Mul<i32> for Int
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl MulAssign<i32> for Int
[src]

[src]

Performs the *= operation.

impl DivAssign<i32> for Int
[src]

[src]

Performs the /= operation.

impl Div<i32> for Int
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl RemAssign<i32> for Int
[src]

[src]

Performs the %= operation.

impl Rem<i32> for Int
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl DivRem<i32> for Int
[src]

[src]

impl BitAndAssign<i32> for Int
[src]

[src]

Performs the &= operation.

impl BitOrAssign<i32> for Int
[src]

[src]

Performs the |= operation.

impl BitXorAssign<i32> for Int
[src]

[src]

Performs the ^= operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl BitAnd<i32> for Int
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitOr<i32> for Int
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitXor<i32> for Int
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl Add<usize> for Int
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl AddAssign<usize> for Int
[src]

[src]

Performs the += operation.

impl Sub<usize> for Int
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl SubAssign<usize> for Int
[src]

[src]

Performs the -= operation.

impl Mul<usize> for Int
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl MulAssign<usize> for Int
[src]

[src]

Performs the *= operation.

impl Div<usize> for Int
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl DivAssign<usize> for Int
[src]

[src]

Performs the /= operation.

impl Rem<usize> for Int
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl RemAssign<usize> for Int
[src]

[src]

Performs the %= operation.

impl DivRem<usize> for Int
[src]

[src]

impl BitAndAssign<usize> for Int
[src]

[src]

Performs the &= operation.

impl BitOrAssign<usize> for Int
[src]

[src]

Performs the |= operation.

impl BitXorAssign<usize> for Int
[src]

[src]

Performs the ^= operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl BitAnd<usize> for Int
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitOr<usize> for Int
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitXor<usize> for Int
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl Add<BaseInt> for Int
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl AddAssign<BaseInt> for Int
[src]

[src]

Performs the += operation.

impl Sub<BaseInt> for Int
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl SubAssign<BaseInt> for Int
[src]

[src]

Performs the -= operation.

impl Mul<BaseInt> for Int
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl MulAssign<BaseInt> for Int
[src]

[src]

Performs the *= operation.

impl Div<BaseInt> for Int
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl DivAssign<BaseInt> for Int
[src]

[src]

Performs the /= operation.

impl Rem<BaseInt> for Int
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl RemAssign<BaseInt> for Int
[src]

[src]

Performs the %= operation.

impl DivRem<BaseInt> for Int
[src]

[src]

impl BitAndAssign<BaseInt> for Int
[src]

[src]

Performs the &= operation.

impl BitOrAssign<BaseInt> for Int
[src]

[src]

Performs the |= operation.

impl BitXorAssign<BaseInt> for Int
[src]

[src]

Performs the ^= operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl BitAnd<BaseInt> for Int
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitOr<BaseInt> for Int
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitXor<BaseInt> for Int
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl PartialEq<i32> for Int
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl PartialOrd<i32> for Int
[src]

[src]

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

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialEq<usize> for Int
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl PartialOrd<usize> for Int
[src]

[src]

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

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialEq<u64> for Int
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl PartialOrd<u64> for Int
[src]

[src]

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

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialEq<i64> for Int
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl PartialOrd<i64> for Int
[src]

[src]

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

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl From<i8> for Int
[src]

[src]

Performs the conversion.

impl From<i16> for Int
[src]

[src]

Performs the conversion.

impl From<i32> for Int
[src]

[src]

Performs the conversion.

impl From<i64> for Int
[src]

[src]

Performs the conversion.

impl From<isize> for Int
[src]

[src]

Performs the conversion.

impl From<u8> for Int
[src]

[src]

Performs the conversion.

impl From<u16> for Int
[src]

[src]

Performs the conversion.

impl From<u32> for Int
[src]

[src]

Performs the conversion.

impl From<u64> for Int
[src]

[src]

Performs the conversion.

impl From<usize> for Int
[src]

[src]

Performs the conversion.

impl Binary for Int
[src]

[src]

Formats the value using the given formatter.

impl Octal for Int
[src]

[src]

Formats the value using the given formatter.

impl Display for Int
[src]

[src]

Formats the value using the given formatter. Read more

impl Debug for Int
[src]

[src]

Formats the value using the given formatter.

impl LowerHex for Int
[src]

[src]

Formats the value using the given formatter.

impl UpperHex for Int
[src]

[src]

Formats the value using the given formatter.

impl FromStr for Int
[src]

The associated error which can be returned from parsing.

[src]

Parses a string s to return a value of this type. Read more

impl Zero for Int
[src]

[src]

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

[src]

Returns true if self is equal to the additive identity.

impl One for Int
[src]

[src]

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

impl Num for Int
[src]

[src]

Convert from a string and radix <= 36. Read more

impl Integer for Int
[src]

[src]

Floored integer division. Read more

[src]

Floored integer modulo, satisfying: Read more

[src]

Greatest Common Divisor (GCD). Read more

[src]

Lowest Common Multiple (LCM). Read more

[src]

Deprecated, use is_multiple_of instead.

[src]

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

[src]

Returns true if the number is even. Read more

[src]

Returns true if the number is odd. Read more

[src]

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

[src]

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

impl Step for Int
[src]

[src]

🔬 This is a nightly-only experimental API. (step_trait)

likely to be replaced by finer-grained traits

Returns the number of steps between two step objects. The count is inclusive of start and exclusive of end. Read more

[src]

🔬 This is a nightly-only experimental API. (step_trait)

likely to be replaced by finer-grained traits

Replaces this step with 1, returning itself

[src]

🔬 This is a nightly-only experimental API. (step_trait)

likely to be replaced by finer-grained traits

Replaces this step with 0, returning itself

[src]

🔬 This is a nightly-only experimental API. (step_trait)

likely to be replaced by finer-grained traits

Adds one to this step, returning the result

[src]

🔬 This is a nightly-only experimental API. (step_trait)

likely to be replaced by finer-grained traits

Subtracts one to this step, returning the result

[src]

🔬 This is a nightly-only experimental API. (step_trait)

likely to be replaced by finer-grained traits

Add an usize, returning None on overflow

impl PartialEq<Rational> for Int
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl PartialOrd<Rational> for Int
[src]

[src]

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

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Add<Rational> for Int
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Mul<Rational> for Int
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Div<Rational> for Int
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.