Fix for namespaced enums.
This commit is contained in:
parent
c0df55e470
commit
233c02030d
|
@ -67,6 +67,7 @@ use std::str::{mod, FromStr};
|
||||||
use std::{i64, u64};
|
use std::{i64, u64};
|
||||||
|
|
||||||
use {Num, Unsigned, CheckedAdd, CheckedSub, CheckedMul, CheckedDiv, Signed, Zero, One};
|
use {Num, Unsigned, CheckedAdd, CheckedSub, CheckedMul, CheckedDiv, Signed, Zero, One};
|
||||||
|
use self::Sign::{Minus, NoSign, Plus};
|
||||||
|
|
||||||
/// A `BigDigit` is a `BigUint`'s composing element.
|
/// A `BigDigit` is a `BigUint`'s composing element.
|
||||||
pub type BigDigit = u32;
|
pub type BigDigit = u32;
|
||||||
|
@ -1471,7 +1472,8 @@ impl BigInt {
|
||||||
mod biguint_tests {
|
mod biguint_tests {
|
||||||
use Integer;
|
use Integer;
|
||||||
use super::{BigDigit, BigUint, ToBigUint, to_str_radix};
|
use super::{BigDigit, BigUint, ToBigUint, to_str_radix};
|
||||||
use super::{Plus, BigInt, RandBigInt, ToBigInt};
|
use super::{BigInt, RandBigInt, ToBigInt};
|
||||||
|
use super::Sign::Plus;
|
||||||
|
|
||||||
use std::cmp::{Less, Equal, Greater};
|
use std::cmp::{Less, Equal, Greater};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
@ -2335,7 +2337,8 @@ mod biguint_tests {
|
||||||
mod bigint_tests {
|
mod bigint_tests {
|
||||||
use Integer;
|
use Integer;
|
||||||
use super::{BigDigit, BigUint, ToBigUint};
|
use super::{BigDigit, BigUint, ToBigUint};
|
||||||
use super::{Sign, Minus, NoSign, Plus, BigInt, RandBigInt, ToBigInt};
|
use super::{Sign, BigInt, RandBigInt, ToBigInt};
|
||||||
|
use super::Sign::{Minus, NoSign, Plus};
|
||||||
|
|
||||||
use std::cmp::{Less, Equal, Greater};
|
use std::cmp::{Less, Equal, Greater};
|
||||||
use std::i64;
|
use std::i64;
|
||||||
|
|
|
@ -18,7 +18,7 @@ use std::str::FromStr;
|
||||||
use std::num::{FromStrRadix, Float};
|
use std::num::{FromStrRadix, Float};
|
||||||
use std::iter::{AdditiveIterator, MultiplicativeIterator};
|
use std::iter::{AdditiveIterator, MultiplicativeIterator};
|
||||||
|
|
||||||
use bigint::{BigInt, BigUint, Sign, Plus, Minus};
|
use bigint::{BigInt, BigUint, Sign};
|
||||||
use {Num, Signed, Zero, One};
|
use {Num, Signed, Zero, One};
|
||||||
|
|
||||||
/// Represents the ratio between 2 numbers.
|
/// Represents the ratio between 2 numbers.
|
||||||
|
@ -186,7 +186,7 @@ impl Ratio<BigInt> {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let (mantissa, exponent, sign) = f.integer_decode();
|
let (mantissa, exponent, sign) = f.integer_decode();
|
||||||
let bigint_sign: Sign = if sign == 1 { Plus } else { Minus };
|
let bigint_sign = if sign == 1 { Sign::Plus } else { Sign::Minus };
|
||||||
if exponent < 0 {
|
if exponent < 0 {
|
||||||
let one: BigInt = One::one();
|
let one: BigInt = One::one();
|
||||||
let denom: BigInt = one << ((-exponent) as uint);
|
let denom: BigInt = one << ((-exponent) as uint);
|
||||||
|
|
Loading…
Reference in New Issue