Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move std::num::Integer to libnum #12326

Merged
merged 1 commit into from
Feb 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/etc/vim/syntax/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator Cloneabl
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize

syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
syn keyword rustTrait Bitwise Bounded Integer
syn keyword rustTrait Bitwise Bounded Fractional
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
syn keyword rustTrait Orderable Signed Unsigned Round
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive
Expand Down
8 changes: 6 additions & 2 deletions src/libnum/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ A `BigUint` is represented as an array of `BigDigit`s.
A `BigInt` is a combination of `BigUint` and `Sign`.
*/

use Integer;

use std::cmp;
use std::cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
use std::num::{Zero, One, ToStrRadix, FromStrRadix};
Expand Down Expand Up @@ -461,7 +463,7 @@ impl Integer for BigUint {

/// Returns `true` if the number can be divided by `other` without leaving a remainder
#[inline]
fn is_multiple_of(&self, other: &BigUint) -> bool { (*self % *other).is_zero() }
fn divides(&self, other: &BigUint) -> bool { (*self % *other).is_zero() }

/// Returns `true` if the number is divisible by `2`
#[inline]
Expand Down Expand Up @@ -1118,7 +1120,7 @@ impl Integer for BigInt {

/// Returns `true` if the number can be divided by `other` without leaving a remainder
#[inline]
fn is_multiple_of(&self, other: &BigInt) -> bool { self.data.is_multiple_of(&other.data) }
fn divides(&self, other: &BigInt) -> bool { self.data.divides(&other.data) }

/// Returns `true` if the number is divisible by `2`
#[inline]
Expand Down Expand Up @@ -1388,6 +1390,7 @@ impl BigInt {

#[cfg(test)]
mod biguint_tests {
use Integer;
use super::{BigDigit, BigUint, ToBigUint};
use super::{Plus, BigInt, RandBigInt, ToBigInt};

Expand Down Expand Up @@ -2045,6 +2048,7 @@ mod biguint_tests {

#[cfg(test)]
mod bigint_tests {
use Integer;
use super::{BigDigit, BigUint, ToBigUint};
use super::{Sign, Minus, Zero, Plus, BigInt, RandBigInt, ToBigInt};

Expand Down
Loading