From 5374279f47f3aa4fbf948242d67a4c19fce3cc3b Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 18 Feb 2026 21:48:16 +0100 Subject: [PATCH] fix a test --- src/nt_funcs.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nt_funcs.rs b/src/nt_funcs.rs index 8eb9b70..c6b6b81 100644 --- a/src/nt_funcs.rs +++ b/src/nt_funcs.rs @@ -23,6 +23,7 @@ use crate::tables::{SMALL_PRIMES_INV, ZETA_LOG_TABLE}; use crate::traits::{FactorizationConfig, Primality, PrimalityTestConfig, PrimalityUtils}; use crate::{BitTest, ExactRoots}; use num_integer::Roots; +#[cfg(feature = "big-table")] use num_modular::DivExact; use num_modular::{ModularCoreOps, ModularInteger, MontgomeryInt}; use num_traits::{CheckedAdd, FromPrimitive, Num, RefNum, ToPrimitive}; @@ -843,7 +844,8 @@ where T::from_u8(SMALL_PRIMES[pos + 1]) } } - Err(pos) => T::from_u8(SMALL_PRIMES[pos]), + Err(pos) if pos < SMALL_PRIMES.len() => T::from_u8(SMALL_PRIMES[pos]), + Err(_) => T::from_u64(SMALL_PRIMES_NEXT), }; }