Skip to content

Commit 7dea339

Browse files
committed
bump num-modular to version 0.6.1
1 parent 64e4360 commit 7dea339

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ readme = "README.md"
1818
[dependencies]
1919
num-integer = "0.1.44"
2020
num-traits = "0.2.14"
21-
num-modular = "0.5.0"
21+
num-modular = "0.6.1"
2222
bitvec = "1.0.0"
2323
rand = "0.8.4"
2424
lru = "0.12.2"
@@ -33,7 +33,7 @@ features = ["rand"]
3333
default = ['big-table', 'big-int']
3434
big-table = []
3535
# TODO: use the new cargo feature to override the num-bigint option
36-
big-int = ['num-bigint', 'num-modular/num-bigint']
36+
big-int = ['num-modular/num-bigint', 'num-modular/num-traits', 'num-modular/num-integer']
3737

3838
[workspace]
3939
members = [

src/mint.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -669,17 +669,17 @@ impl<T: Integer + Clone, R: Reducer<T> + Clone> ModularPow<&Self, &Self> for Min
669669
#[inline]
670670
fn powm(self, exp: &Self, m: &Self) -> Self::Output {
671671
Self(Right(match (self.0, &exp.0, &m.0) {
672-
(Left(v), Left(e), Left(m)) => ReducedInt::new(v, m).pow(e.clone()),
672+
(Left(v), Left(e), Left(m)) => ReducedInt::new(v, m).pow(&e.clone()),
673673
(Right(v), Left(e), Left(m)) => {
674674
debug_assert!(&v.modulus() == m);
675-
v.pow(e.clone())
675+
v.pow(&e.clone())
676676
}
677677
(_, _, _) => unreachable!(),
678678
}))
679679
}
680680
}
681681

682-
pub type SmallMint<T> = Mint<T, Montgomery<T, T>>;
682+
pub type SmallMint<T> = Mint<T, Montgomery<T>>;
683683

684684
#[cfg(test)]
685685
mod tests {

src/nt_funcs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use crate::tables::{SMALL_PRIMES_INV, ZETA_LOG_TABLE};
2424
use crate::traits::{FactorizationConfig, Primality, PrimalityTestConfig, PrimalityUtils};
2525
use crate::{BitTest, ExactRoots};
2626
use num_integer::Roots;
27-
#[cfg(feature = "num-bigint")]
2827
use num_modular::DivExact;
2928
use num_modular::{ModularCoreOps, ModularInteger, MontgomeryInt};
3029
use num_traits::{CheckedAdd, FromPrimitive, Num, RefNum, ToPrimitive};

src/tables.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub const SMALL_PRIMES_NEXT: u64 = 8167;
8989

9090
//////////////////// Pre-computed inversions for primes ////////////////////
9191
#[cfg(feature = "big-table")]
92-
type P64 = num_modular::PreInv<u64>;
92+
type P64 = num_modular::PreModInv<u64>;
9393

9494
/// Precomputed modular inverse for fast divisibility check
9595
///

0 commit comments

Comments
 (0)