1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-02 05:57:46 +00:00

factor::miller_rabin: Add test for the largest 64b composite numbers

This commit is contained in:
nicoo 2020-07-04 20:26:02 +02:00
parent 308290325a
commit 0a1200bdb8

View file

@ -121,6 +121,13 @@ mod tests {
assert!(is_prime(LARGEST_U64_PRIME)); assert!(is_prime(LARGEST_U64_PRIME));
} }
#[test]
fn largest_composites() {
for i in LARGEST_U64_PRIME + 1..=u64::MAX {
assert!(!is_prime(i), "2⁶⁴ - {} reported prime", u64::MAX - i + 1);
}
}
#[test] #[test]
fn first_primes() { fn first_primes() {
use crate::table::{NEXT_PRIME, P_INVS_U64}; use crate::table::{NEXT_PRIME, P_INVS_U64};