@@ -33,7 +33,7 @@ use core::str::FromStr;
3333#[ cfg( feature = "std" ) ]
3434use std:: error:: Error ;
3535
36- #[ cfg( feature = "bigint" ) ]
36+ #[ cfg( feature = "num- bigint" ) ]
3737use num_bigint:: { BigInt , BigUint , Sign , ToBigInt } ;
3838
3939use num_integer:: Integer ;
@@ -63,7 +63,7 @@ pub type Rational32 = Ratio<i32>;
6363/// Alias for a `Ratio` of 64-bit-sized integers.
6464pub type Rational64 = Ratio < i64 > ;
6565
66- #[ cfg( feature = "bigint" ) ]
66+ #[ cfg( feature = "num- bigint" ) ]
6767/// Alias for arbitrary precision rationals.
6868pub type BigRational = Ratio < BigInt > ;
6969
@@ -257,7 +257,7 @@ impl<T: Clone + Integer> Ratio<T> {
257257 }
258258}
259259
260- #[ cfg( feature = "bigint" ) ]
260+ #[ cfg( feature = "num- bigint" ) ]
261261impl Ratio < BigInt > {
262262 /// Converts a float into a rational number.
263263 pub fn from_float < T : FloatCore > ( f : T ) -> Option < BigRational > {
@@ -1173,7 +1173,7 @@ impl RatioErrorKind {
11731173 }
11741174}
11751175
1176- #[ cfg( feature = "bigint" ) ]
1176+ #[ cfg( feature = "num- bigint" ) ]
11771177impl FromPrimitive for Ratio < BigInt > {
11781178 fn from_i64 ( n : i64 ) -> Option < Self > {
11791179 Some ( Ratio :: from_integer ( n. into ( ) ) )
@@ -1361,7 +1361,7 @@ where
13611361 Some ( Ratio :: new ( n1, d1) )
13621362}
13631363
1364- #[ cfg( not( feature = "bigint" ) ) ]
1364+ #[ cfg( not( feature = "num- bigint" ) ) ]
13651365macro_rules! to_primitive_small {
13661366 ( $( $type_name: ty) * ) => ( $(
13671367 impl ToPrimitive for Ratio <$type_name> {
@@ -1388,13 +1388,13 @@ macro_rules! to_primitive_small {
13881388 ) * )
13891389}
13901390
1391- #[ cfg( not( feature = "bigint" ) ) ]
1391+ #[ cfg( not( feature = "num- bigint" ) ) ]
13921392to_primitive_small ! ( u8 i8 u16 i16 u32 i32 ) ;
13931393
1394- #[ cfg( all( target_pointer_width = "32" , not( feature = "bigint" ) ) ) ]
1394+ #[ cfg( all( target_pointer_width = "32" , not( feature = "num- bigint" ) ) ) ]
13951395to_primitive_small ! ( usize isize ) ;
13961396
1397- #[ cfg( not( feature = "bigint" ) ) ]
1397+ #[ cfg( not( feature = "num- bigint" ) ) ]
13981398macro_rules! to_primitive_64 {
13991399 ( $( $type_name: ty) * ) => ( $(
14001400 impl ToPrimitive for Ratio <$type_name> {
@@ -1424,13 +1424,13 @@ macro_rules! to_primitive_64 {
14241424 ) * )
14251425}
14261426
1427- #[ cfg( not( feature = "bigint" ) ) ]
1427+ #[ cfg( not( feature = "num- bigint" ) ) ]
14281428to_primitive_64 ! ( u64 i64 ) ;
14291429
1430- #[ cfg( all( target_pointer_width = "64" , not( feature = "bigint" ) ) ) ]
1430+ #[ cfg( all( target_pointer_width = "64" , not( feature = "num- bigint" ) ) ) ]
14311431to_primitive_64 ! ( usize isize ) ;
14321432
1433- #[ cfg( feature = "bigint" ) ]
1433+ #[ cfg( feature = "num- bigint" ) ]
14341434impl < T : Clone + Integer + ToPrimitive + ToBigInt > ToPrimitive for Ratio < T > {
14351435 fn to_i64 ( & self ) -> Option < i64 > {
14361436 self . to_integer ( ) . to_i64 ( )
@@ -1467,7 +1467,7 @@ trait Bits {
14671467 fn bits ( & self ) -> u64 ;
14681468}
14691469
1470- #[ cfg( feature = "bigint" ) ]
1470+ #[ cfg( feature = "num- bigint" ) ]
14711471impl Bits for BigInt {
14721472 fn bits ( & self ) -> u64 {
14731473 self . bits ( )
@@ -1590,9 +1590,9 @@ fn hash<T: Hash>(x: &T) -> u64 {
15901590
15911591#[ cfg( test) ]
15921592mod test {
1593- #[ cfg( all( feature = "bigint" ) ) ]
1593+ #[ cfg( all( feature = "num- bigint" ) ) ]
15941594 use super :: BigInt ;
1595- #[ cfg( feature = "bigint" ) ]
1595+ #[ cfg( feature = "num- bigint" ) ]
15961596 use super :: BigRational ;
15971597 use super :: { Ratio , Rational , Rational64 } ;
15981598
@@ -1676,14 +1676,14 @@ mod test {
16761676 denom : 1 ,
16771677 } ;
16781678
1679- #[ cfg( feature = "bigint" ) ]
1679+ #[ cfg( feature = "num- bigint" ) ]
16801680 pub fn to_big ( n : Rational ) -> BigRational {
16811681 Ratio :: new (
16821682 FromPrimitive :: from_isize ( n. numer ) . unwrap ( ) ,
16831683 FromPrimitive :: from_isize ( n. denom ) . unwrap ( ) ,
16841684 )
16851685 }
1686- #[ cfg( not( feature = "bigint" ) ) ]
1686+ #[ cfg( not( feature = "num- bigint" ) ) ]
16871687 pub fn to_big ( n : Rational ) -> Rational {
16881688 Ratio :: new (
16891689 FromPrimitive :: from_isize ( n. numer ) . unwrap ( ) ,
@@ -2607,11 +2607,11 @@ mod test {
26072607 assert_eq ! ( Pow :: pow( r, & e) , expected) ;
26082608 assert_eq ! ( Pow :: pow( & r, e) , expected) ;
26092609 assert_eq ! ( Pow :: pow( & r, & e) , expected) ;
2610- #[ cfg( feature = "bigint" ) ]
2610+ #[ cfg( feature = "num- bigint" ) ]
26112611 test_big ( r, e, expected) ;
26122612 }
26132613
2614- #[ cfg( feature = "bigint" ) ]
2614+ #[ cfg( feature = "num- bigint" ) ]
26152615 fn test_big ( r : Rational , e : i32 , expected : Rational ) {
26162616 let r = BigRational :: new_raw ( r. numer . into ( ) , r. denom . into ( ) ) ;
26172617 let expected = BigRational :: new_raw ( expected. numer . into ( ) , expected. denom . into ( ) ) ;
@@ -2662,7 +2662,7 @@ mod test {
26622662 }
26632663 }
26642664
2665- #[ cfg( feature = "bigint" ) ]
2665+ #[ cfg( feature = "num- bigint" ) ]
26662666 #[ test]
26672667 fn test_from_float ( ) {
26682668 use num_traits:: float:: FloatCore ;
@@ -2709,7 +2709,7 @@ mod test {
27092709 ) ;
27102710 }
27112711
2712- #[ cfg( feature = "bigint" ) ]
2712+ #[ cfg( feature = "num- bigint" ) ]
27132713 #[ test]
27142714 fn test_from_float_fail ( ) {
27152715 use core:: { f32, f64} ;
@@ -2870,7 +2870,7 @@ mod test {
28702870 }
28712871
28722872 #[ test]
2873- #[ cfg( feature = "bigint" ) ]
2873+ #[ cfg( feature = "num- bigint" ) ]
28742874 fn test_ratio_to_i128 ( ) {
28752875 assert_eq ! (
28762876 1i128 << 70 ,
@@ -2881,7 +2881,7 @@ mod test {
28812881 }
28822882
28832883 #[ test]
2884- #[ cfg( feature = "bigint" ) ]
2884+ #[ cfg( feature = "num- bigint" ) ]
28852885 fn test_big_ratio_to_f64 ( ) {
28862886 assert_eq ! (
28872887 BigRational :: new(
0 commit comments