Struct rugint::Integer
[−]
[src]
pub struct Integer { /* fields omitted */ }
An arbitrary-precision integer.
Standard arithmetic operations, bitwise operations and comparisons
are supported. In standard arithmetic operations such as addition,
you can mix Integer
and primitive integer types; the result will
be an Integer
.
Internally the integer is not stored using two's-complement representation, however, for bitwise operations and shifts, the functionality is the same as if the representation was using two's complement.
Examples
use rugint::Integer; let mut i = Integer::from(1); i = i << 1000; // i is now 1000000... (1000 zeros) assert!(i.significant_bits() == 1001); assert!(i.find_one(0) == Some(1000)); i -= 1; // i is now 111111... (1000 ones) assert!(i.count_ones() == Some(1000)); let a = Integer::from(0xf00d); let all_ones_xor_a = Integer::from(-1) ^ &a; // a is unchanged as we borrowed it let complement_a = !a; // now a has been moved, so this would cause an error: // assert!(a > 0); assert!(all_ones_xor_a == complement_a); assert!(complement_a == -0xf00e); assert!(format!("{:x}", complement_a) == "-f00e");
Methods
impl Integer
[src]
fn new() -> Integer
Constructs a new arbitrary-precision integer with value 0.
fn to_u32(&self) -> Option<u32>
Converts to a u32
if the value fits.
fn to_u32_wrapping(&self) -> u32
Converts to a u32
, wrapping if the value is too large.
fn to_i32(&self) -> Option<i32>
Converts to an i32
if the value fits.
fn to_i32_wrapping(&self) -> i32
Converts to an i32
, wrapping if the value is too large.
fn to_f64(&self) -> f64
Converts to an f64
, rounding towards zero.
fn to_f32(&self) -> f32
Converts to an f32
, rounding towards zero.
fn div_rem(&mut self, divisor: &mut Integer)
fn abs(&mut self) -> &mut Integer
Computes the absolute value of self
.
fn div_exact(&mut self, other: &Integer) -> &mut Integer
Divides self
by other
. This is much faster than normal
division, but produces correct results only when the division
is exact.
Panics
Panics if other
is zero.
fn is_divisible(&self, other: &Integer) -> bool
Returns true
if self
is divisible by other
.
fn is_congruent(&self, c: &Integer, d: &Integer) -> bool
Returns true
if self
is congruent to c
modulo d
, that
is, if there exists a q
such that self == c + q * d
.
Unlike other division functions, d
can be zero.
fn root(&mut self, n: u32) -> &mut Integer
Computes the n
th root of self
and truncates the result.
fn root_rem(&mut self, buf: &mut Integer, n: u32)
Computes the n
th root of self
and returns the truncated
root and the remainder. The remainder is self
minus the
truncated root raised to the power of n
.
The remainder is stored in buf
.
fn sqrt(&mut self) -> &mut Integer
Computes the square root of self
and truncates the result.
fn sqrt_rem(&mut self, buf: &mut Integer)
Computes the square root of self
and returns the truncated
root and the remainder. The remainder is self
minus the
truncated root squared.
The remainder is stored in buf
.
fn is_perfect_power(&self) -> bool
Returns true
if self
is a perfect power.
fn is_perfect_square(&self) -> bool
Returns true
if self
is a perfect square.
fn gcd(&mut self, other: &Integer) -> &mut Integer
Finds the greatest common divisor. The result is always positive except when both inputs are zero.
fn lcm(&mut self, other: &Integer) -> &mut Integer
Finds the least common multiple. The result is always positive except when one or both inputs are zero.
fn invert(&mut self, m: &Integer) -> Option<&mut Integer>
fn set_factorial(&mut self, n: u32) -> &mut Integer
Computes the factorial of n
.
The value of self
is ignored.
fn set_factorial_2(&mut self, n: u32) -> &mut Integer
Computes the double factorial of n
.
The value of self
is ignored.
fn set_factorial_m(&mut self, n: u32, m: u32) -> &mut Integer
Computes the m
-multi factorial of n
.
The value of self
is ignored.
fn set_primorial(&mut self, n: u32) -> &mut Integer
Computes the primorial of n
.
The value of self
is ignored.
fn binomial(&mut self, k: u32) -> &mut Integer
Computes the binomial coefficient self
over k
.
fn set_binomial(&mut self, n: u32, k: u32) -> &mut Integer
Computes the binomial coefficient n
over k
.
The value of self
is ignored.
fn cmp_abs(&self, other: &Integer) -> Ordering
Compares the absolute values of self
and other
.
fn sign(&self) -> Ordering
Returns the same result as self.cmp(0), but is faster.
fn significant_bits(&self) -> u32
Returns the number of bits required to represent the absolute
value of self
.
Examples
use rugint::Integer; assert!(Integer::from(0).significant_bits() == 0); assert!(Integer::from(1).significant_bits() == 1); assert!(Integer::from(-1).significant_bits() == 1); assert!(Integer::from(4).significant_bits() == 3); assert!(Integer::from(-4).significant_bits() == 3); assert!(Integer::from(7).significant_bits() == 3); assert!(Integer::from(-7).significant_bits() == 3);
fn count_ones(&self) -> Option<u32>
Returns the number of ones in self
if the value >= 0.
Examples
use rugint::Integer; assert!(Integer::from(0).count_ones() == Some(0)); assert!(Integer::from(15).count_ones() == Some(4)); assert!(Integer::from(-1).count_ones() == None);
fn ham_dist(&self, other: &Integer) -> Option<u32>
Retuns the Hamming distance between self
and other
if they
have the same sign.
Examples
use rugint::Integer; let i = Integer::from(-1); assert!(Integer::from(0).ham_dist(&i) == None); assert!(Integer::from(-1).ham_dist(&i) == Some(0)); assert!(Integer::from(-13).ham_dist(&i) == Some(2));
fn find_zero(&self, start: u32) -> Option<u32>
Returns the location of the first zero, starting at start
.
If the bit at location start
is zero, returns start
.
use rugint::Integer; assert!(Integer::from(-2).find_zero(0) == Some(0)); assert!(Integer::from(-2).find_zero(1) == None); assert!(Integer::from(15).find_zero(0) == Some(4)); assert!(Integer::from(15).find_zero(20) == Some(20));
fn find_one(&self, start: u32) -> Option<u32>
Returns the location of the first one, starting at start
.
If the bit at location start
is one, returns start
.
use rugint::Integer; assert!(Integer::from(1).find_one(0) == Some(0)); assert!(Integer::from(1).find_one(1) == None); assert!(Integer::from(-16).find_one(0) == Some(4)); assert!(Integer::from(-16).find_one(20) == Some(20));
fn set_bit(&mut self, index: u32, val: bool) -> &mut Integer
Sets the bit at location index
to 1 if val
is true
or 0
if val
is false
.
fn get_bit(&self, index: u32) -> bool
Returns true
if the bit at location index
is 1 or false
if the bit is 0.
fn invert_bit(&mut self, index: u32) -> &mut Integer
Toggles the bit at location index
.
fn assign_random_bits<R: Rng>(&mut self, bits: u32, rng: &mut R)
Generates a random number with a specified maximum number of bits.
Examples
extern crate rand; extern crate rugint; use rugint::Integer; fn main() { let mut rng = rand::thread_rng(); let mut i = Integer::new(); i.assign_random_bits(0, &mut rng); assert!(i == 0); i.assign_random_bits(80, &mut rng); assert!(i.significant_bits() <= 80); }
fn random_below<R: Rng>(&mut self, rng: &mut R) -> &mut Integer
Generates a non-negative random number below the given boundary value.
Examples
extern crate rand; extern crate rugint; use rugint::Integer; fn main() { let mut rng = rand::thread_rng(); let bound = Integer::from(15); let mut random = bound.clone(); random.random_below(&mut rng); println!("0 <= {} < {}", random, bound); assert!(random < bound); }
Panics
Panics if the boundary value is less than or equal to zero.
fn to_string_radix(&self, radix: i32) -> String
Returns a string representation of self
for the specified
radix
.
Examples
use rugint::{Assign, Integer}; let mut i = Integer::new(); assert!(i.to_string_radix(10) == "0"); i.assign(-10); assert!(i.to_string_radix(16) == "-a"); i.assign(0x1234cdef); assert!(i.to_string_radix(4) == "102031030313233"); i.assign_str_radix("1234567890aAbBcCdDeEfF", 16).unwrap(); assert!(i.to_string_radix(16) == "1234567890aabbccddeeff");
Panics
Panics if radix
is less than 2 or greater than 36.
fn from_str_radix(src: &str, radix: i32) -> Result<Integer, ParseIntegerError>
Parses an Integer
.
See the corresponding assignment.
Panics
Panics if radix
is less than 2 or greater than 36.
fn assign_str(&mut self, src: &str) -> Result<(), ParseIntegerError>
Parses an Integer
from a string in decimal.
Examples
use rugint::Integer; let mut i = Integer::new(); i.assign_str("123").unwrap(); assert!(i == 123); let ret = i.assign_str("bad"); assert!(ret.is_err());
fn assign_str_radix(&mut self,
src: &str,
radix: i32)
-> Result<(), ParseIntegerError>
src: &str,
radix: i32)
-> Result<(), ParseIntegerError>
Parses an Integer
from a string with the specified radix.
Examples
use rugint::Integer; let mut i = Integer::new(); i.assign_str_radix("ff", 16).unwrap(); assert!(i == 255);
Panics
Panics if radix
is less than 2 or greater than 36.
fn valid_str_radix(src: &str, radix: i32) -> Result<(), ParseIntegerError>
Checks if an Integer
can be parsed.
If this method does not return an error, neither will any
other function that parses an Integer
. If this method
returns an error, the other functions will return the same
error.
Panics
Panics if radix
is less than 2 or greater than 36.
Trait Implementations
impl Drop for Integer
[src]
impl Default for Integer
[src]
impl Clone for Integer
[src]
fn clone(&self) -> Integer
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Integer)
Performs copy-assignment from source
. Read more
impl FromStr for Integer
[src]
type Err = ParseIntegerError
The associated error which can be returned from parsing.
fn from_str(src: &str) -> Result<Integer, ParseIntegerError>
Parses an Integer
.
See the corresponding assignment.
impl<'a> From<&'a Integer> for Integer
[src]
impl From<u32> for Integer
[src]
impl From<i32> for Integer
[src]
impl<'a> Assign<&'a Integer> for Integer
[src]
impl<'a> Assign<Integer> for Integer
[src]
impl Assign<u32> for Integer
[src]
impl Assign<i32> for Integer
[src]
impl Assign<f64> for Integer
[src]
impl Assign<f32> for Integer
[src]
impl<'a> Add<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the +
operator
fn add(self, op: &'a Integer) -> Integer
The method for the +
operator
impl Add<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the +
operator
fn add(self, op: Integer) -> Integer
The method for the +
operator
impl<'a> AddAssign<&'a Integer> for Integer
[src]
fn add_assign(&mut self, op: &'a Integer)
The method for the +=
operator
impl AddAssign<Integer> for Integer
[src]
fn add_assign(&mut self, op: Integer)
The method for the +=
operator
impl<'a> Sub<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the -
operator
fn sub(self, op: &'a Integer) -> Integer
The method for the -
operator
impl Sub<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the -
operator
fn sub(self, op: Integer) -> Integer
The method for the -
operator
impl<'a> SubAssign<&'a Integer> for Integer
[src]
fn sub_assign(&mut self, op: &'a Integer)
The method for the -=
operator
impl SubAssign<Integer> for Integer
[src]
fn sub_assign(&mut self, op: Integer)
The method for the -=
operator
impl<'a> SubFromAssign<&'a Integer> for Integer
[src]
fn sub_from_assign(&mut self, lhs: &'a Integer)
Peforms the subtraction.
impl SubFromAssign<Integer> for Integer
[src]
fn sub_from_assign(&mut self, lhs: Integer)
Peforms the subtraction.
impl<'a> Mul<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the *
operator
fn mul(self, op: &'a Integer) -> Integer
The method for the *
operator
impl Mul<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the *
operator
fn mul(self, op: Integer) -> Integer
The method for the *
operator
impl<'a> MulAssign<&'a Integer> for Integer
[src]
fn mul_assign(&mut self, op: &'a Integer)
The method for the *=
operator
impl MulAssign<Integer> for Integer
[src]
fn mul_assign(&mut self, op: Integer)
The method for the *=
operator
impl<'a> Div<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the /
operator
fn div(self, op: &'a Integer) -> Integer
The method for the /
operator
impl Div<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the /
operator
fn div(self, op: Integer) -> Integer
The method for the /
operator
impl<'a> DivAssign<&'a Integer> for Integer
[src]
fn div_assign(&mut self, op: &'a Integer)
The method for the /=
operator
impl DivAssign<Integer> for Integer
[src]
fn div_assign(&mut self, op: Integer)
The method for the /=
operator
impl<'a> DivFromAssign<&'a Integer> for Integer
[src]
fn div_from_assign(&mut self, lhs: &'a Integer)
Peforms the division.
impl DivFromAssign<Integer> for Integer
[src]
fn div_from_assign(&mut self, lhs: Integer)
Peforms the division.
impl<'a> Rem<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the %
operator
fn rem(self, op: &'a Integer) -> Integer
The method for the %
operator
impl Rem<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the %
operator
fn rem(self, op: Integer) -> Integer
The method for the %
operator
impl<'a> RemAssign<&'a Integer> for Integer
[src]
fn rem_assign(&mut self, op: &'a Integer)
The method for the %=
operator
impl RemAssign<Integer> for Integer
[src]
fn rem_assign(&mut self, op: Integer)
The method for the %=
operator
impl<'a> RemFromAssign<&'a Integer> for Integer
[src]
fn rem_from_assign(&mut self, lhs: &'a Integer)
Peforms the remainder operation.
impl RemFromAssign<Integer> for Integer
[src]
fn rem_from_assign(&mut self, lhs: Integer)
Peforms the remainder operation.
impl<'a> BitAnd<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the &
operator
fn bitand(self, op: &'a Integer) -> Integer
The method for the &
operator
impl BitAnd<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the &
operator
fn bitand(self, op: Integer) -> Integer
The method for the &
operator
impl<'a> BitAndAssign<&'a Integer> for Integer
[src]
fn bitand_assign(&mut self, op: &'a Integer)
The method for the &=
operator
impl BitAndAssign<Integer> for Integer
[src]
fn bitand_assign(&mut self, op: Integer)
The method for the &=
operator
impl<'a> BitOr<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the |
operator
fn bitor(self, op: &'a Integer) -> Integer
The method for the |
operator
impl BitOr<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the |
operator
fn bitor(self, op: Integer) -> Integer
The method for the |
operator
impl<'a> BitOrAssign<&'a Integer> for Integer
[src]
fn bitor_assign(&mut self, op: &'a Integer)
The method for the |=
operator
impl BitOrAssign<Integer> for Integer
[src]
fn bitor_assign(&mut self, op: Integer)
The method for the |=
operator
impl<'a> BitXor<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the ^
operator
fn bitxor(self, op: &'a Integer) -> Integer
The method for the ^
operator
impl BitXor<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the ^
operator
fn bitxor(self, op: Integer) -> Integer
The method for the ^
operator
impl<'a> BitXorAssign<&'a Integer> for Integer
[src]
fn bitxor_assign(&mut self, op: &'a Integer)
The method for the ^=
operator
impl BitXorAssign<Integer> for Integer
[src]
fn bitxor_assign(&mut self, op: Integer)
The method for the ^=
operator
impl Neg for Integer
[src]
type Output = Integer
The resulting type after applying the -
operator
fn neg(self) -> Integer
The method for the unary -
operator
impl NegAssign for Integer
[src]
fn neg_assign(&mut self)
Peforms the negation.
impl Not for Integer
[src]
type Output = Integer
The resulting type after applying the !
operator
fn not(self) -> Integer
The method for the unary !
operator
impl NotAssign for Integer
[src]
fn not_assign(&mut self)
Peforms the complement.
impl Add<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the +
operator
fn add(self, op: u32) -> Integer
The method for the +
operator
impl AddAssign<u32> for Integer
[src]
fn add_assign(&mut self, op: u32)
The method for the +=
operator
impl Sub<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the -
operator
fn sub(self, op: u32) -> Integer
The method for the -
operator
impl SubAssign<u32> for Integer
[src]
fn sub_assign(&mut self, op: u32)
The method for the -=
operator
impl SubFromAssign<u32> for Integer
[src]
fn sub_from_assign(&mut self, lhs: u32)
Peforms the subtraction.
impl Mul<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the *
operator
fn mul(self, op: u32) -> Integer
The method for the *
operator
impl MulAssign<u32> for Integer
[src]
fn mul_assign(&mut self, op: u32)
The method for the *=
operator
impl Div<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the /
operator
fn div(self, op: u32) -> Integer
The method for the /
operator
impl DivAssign<u32> for Integer
[src]
fn div_assign(&mut self, op: u32)
The method for the /=
operator
impl DivFromAssign<u32> for Integer
[src]
fn div_from_assign(&mut self, lhs: u32)
Peforms the division.
impl Rem<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the %
operator
fn rem(self, op: u32) -> Integer
The method for the %
operator
impl RemAssign<u32> for Integer
[src]
fn rem_assign(&mut self, op: u32)
The method for the %=
operator
impl RemFromAssign<u32> for Integer
[src]
fn rem_from_assign(&mut self, lhs: u32)
Peforms the remainder operation.
impl Shl<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the <<
operator
fn shl(self, op: u32) -> Integer
The method for the <<
operator
impl ShlAssign<u32> for Integer
[src]
fn shl_assign(&mut self, op: u32)
The method for the <<=
operator
impl Shr<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the >>
operator
fn shr(self, op: u32) -> Integer
The method for the >>
operator
impl ShrAssign<u32> for Integer
[src]
fn shr_assign(&mut self, op: u32)
The method for the >>=
operator
impl Pow<u32> for Integer
[src]
type Output = Integer
The resulting type after the power operation.
fn pow(self, op: u32) -> Integer
Performs the power operation.
impl PowAssign<u32> for Integer
[src]
fn pow_assign(&mut self, op: u32)
Peforms the power operation.
impl BitAnd<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the &
operator
fn bitand(self, op: u32) -> Integer
The method for the &
operator
impl BitAndAssign<u32> for Integer
[src]
fn bitand_assign(&mut self, op: u32)
The method for the &=
operator
impl BitOr<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the |
operator
fn bitor(self, op: u32) -> Integer
The method for the |
operator
impl BitOrAssign<u32> for Integer
[src]
fn bitor_assign(&mut self, op: u32)
The method for the |=
operator
impl BitXor<u32> for Integer
[src]
type Output = Integer
The resulting type after applying the ^
operator
fn bitxor(self, op: u32) -> Integer
The method for the ^
operator
impl BitXorAssign<u32> for Integer
[src]
fn bitxor_assign(&mut self, op: u32)
The method for the ^=
operator
impl Add<i32> for Integer
[src]
type Output = Integer
The resulting type after applying the +
operator
fn add(self, op: i32) -> Integer
The method for the +
operator
impl AddAssign<i32> for Integer
[src]
fn add_assign(&mut self, op: i32)
The method for the +=
operator
impl Sub<i32> for Integer
[src]
type Output = Integer
The resulting type after applying the -
operator
fn sub(self, op: i32) -> Integer
The method for the -
operator
impl SubAssign<i32> for Integer
[src]
fn sub_assign(&mut self, op: i32)
The method for the -=
operator
impl SubFromAssign<i32> for Integer
[src]
fn sub_from_assign(&mut self, lhs: i32)
Peforms the subtraction.
impl Mul<i32> for Integer
[src]
type Output = Integer
The resulting type after applying the *
operator
fn mul(self, op: i32) -> Integer
The method for the *
operator
impl MulAssign<i32> for Integer
[src]
fn mul_assign(&mut self, op: i32)
The method for the *=
operator
impl Div<i32> for Integer
[src]
type Output = Integer
The resulting type after applying the /
operator
fn div(self, op: i32) -> Integer
The method for the /
operator
impl DivAssign<i32> for Integer
[src]
fn div_assign(&mut self, op: i32)
The method for the /=
operator
impl DivFromAssign<i32> for Integer
[src]
fn div_from_assign(&mut self, lhs: i32)
Peforms the division.
impl Rem<i32> for Integer
[src]
type Output = Integer
The resulting type after applying the %
operator
fn rem(self, op: i32) -> Integer
The method for the %
operator
impl RemAssign<i32> for Integer
[src]
fn rem_assign(&mut self, op: i32)
The method for the %=
operator
impl RemFromAssign<i32> for Integer
[src]
fn rem_from_assign(&mut self, lhs: i32)
Peforms the remainder operation.
impl Shl<i32> for Integer
[src]
type Output = Integer
The resulting type after applying the <<
operator
fn shl(self, op: i32) -> Integer
The method for the <<
operator
impl ShlAssign<i32> for Integer
[src]
fn shl_assign(&mut self, op: i32)
The method for the <<=
operator
impl Shr<i32> for Integer
[src]
type Output = Integer
The resulting type after applying the >>
operator
fn shr(self, op: i32) -> Integer
The method for the >>
operator
impl ShrAssign<i32> for Integer
[src]
fn shr_assign(&mut self, op: i32)
The method for the >>=
operator
impl Eq for Integer
[src]
impl Ord for Integer
[src]
fn cmp(&self, other: &Integer) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl PartialEq for Integer
[src]
fn eq(&self, other: &Integer) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl PartialOrd for Integer
[src]
fn partial_cmp(&self, other: &Integer) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialOrd<f64> for Integer
[src]
fn partial_cmp(&self, other: &f64) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq<f64> for Integer
[src]
fn eq(&self, other: &f64) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl PartialOrd<f32> for Integer
[src]
fn partial_cmp(&self, other: &f32) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq<f32> for Integer
[src]
fn eq(&self, other: &f32) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl PartialOrd<u32> for Integer
[src]
fn partial_cmp(&self, other: &u32) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq<u32> for Integer
[src]
fn eq(&self, other: &u32) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl PartialOrd<i32> for Integer
[src]
fn partial_cmp(&self, other: &i32) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq<i32> for Integer
[src]
fn eq(&self, other: &i32) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.