|
1 | 1 | use crate::rvals::{IntoSteelVal, Result, SteelComplex, SteelVal};
|
2 | 2 | use crate::{steelerr, stop};
|
3 |
| -use num::Zero; |
4 |
| -use num::{ |
5 |
| - pow::Pow, BigInt, BigRational, CheckedAdd, CheckedMul, Integer, Rational32, Signed, ToPrimitive, |
6 |
| -}; |
| 3 | +use num_bigint::BigInt; |
| 4 | +use num_integer::Integer; |
| 5 | +use num_rational::{BigRational, Rational32}; |
| 6 | +use num_traits::{pow::Pow, CheckedAdd, CheckedMul, Signed, ToPrimitive, Zero}; |
7 | 7 | use std::ops::Neg;
|
8 | 8 |
|
9 | 9 | /// Checks if the given value is a number
|
@@ -957,8 +957,8 @@ fn expt(left: &SteelVal, right: &SteelVal) -> Result<SteelVal> {
|
957 | 957 |
|
958 | 958 | let expt = BigInt::from(*l).pow(r.magnitude());
|
959 | 959 | match r.sign() {
|
960 |
| - num::bigint::Sign::Plus | num::bigint::Sign::NoSign => expt.into_steelval(), |
961 |
| - num::bigint::Sign::Minus => { |
| 960 | + num_bigint::Sign::Plus | num_bigint::Sign::NoSign => expt.into_steelval(), |
| 961 | + num_bigint::Sign::Minus => { |
962 | 962 | BigRational::new_raw(BigInt::from(1), expt).into_steelval()
|
963 | 963 | }
|
964 | 964 | }
|
@@ -1003,8 +1003,8 @@ fn expt(left: &SteelVal, right: &SteelVal) -> Result<SteelVal> {
|
1003 | 1003 | (SteelVal::BigNum(l), SteelVal::BigNum(r)) => {
|
1004 | 1004 | let expt = l.as_ref().clone().pow(r.magnitude());
|
1005 | 1005 | match r.sign() {
|
1006 |
| - num::bigint::Sign::NoSign | num::bigint::Sign::Plus => expt.into_steelval(), |
1007 |
| - num::bigint::Sign::Minus => { |
| 1006 | + num_bigint::Sign::NoSign | num_bigint::Sign::Plus => expt.into_steelval(), |
| 1007 | + num_bigint::Sign::Minus => { |
1008 | 1008 | BigRational::new_raw(BigInt::from(1), expt).into_steelval()
|
1009 | 1009 | }
|
1010 | 1010 | }
|
@@ -1412,7 +1412,7 @@ fn exact_integer_sqrt(number: &SteelVal) -> Result<SteelVal> {
|
1412 | 1412 |
|
1413 | 1413 | fn exact_integer_impl<'a, N>(target: &'a N) -> (N, N)
|
1414 | 1414 | where
|
1415 |
| - N: num::integer::Roots + Clone, |
| 1415 | + N: num_integer::Roots + Clone, |
1416 | 1416 | &'a N: std::ops::Mul<&'a N, Output = N>,
|
1417 | 1417 | N: std::ops::Sub<N, Output = N>,
|
1418 | 1418 | {
|
@@ -1862,7 +1862,7 @@ mod num_op_tests {
|
1862 | 1862 | )
|
1863 | 1863 | .unwrap()
|
1864 | 1864 | .to_string(),
|
1865 |
| - BigRational(Gc::new(num::BigRational::new( |
| 1865 | + BigRational(Gc::new(num_rational::BigRational::new( |
1866 | 1866 | BigInt::from(1),
|
1867 | 1867 | BigInt::from_str("18446744073709551616").unwrap()
|
1868 | 1868 | )))
|
@@ -2014,7 +2014,7 @@ mod num_op_tests {
|
2014 | 2014 | )
|
2015 | 2015 | .is_err());
|
2016 | 2016 | assert!(exact_integer_sqrt(
|
2017 |
| - &num::BigRational::new( |
| 2017 | + &num_rational::BigRational::new( |
2018 | 2018 | BigInt::from_str("-10000000000000000000000000000000000001").unwrap(),
|
2019 | 2019 | BigInt::from_str("2").unwrap()
|
2020 | 2020 | )
|
|
0 commit comments