mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 21:47:46 +00:00
factor::miller_rabin: Add negative test over all small composites
This commit is contained in:
parent
600268c6e4
commit
1e4d824829
1 changed files with 12 additions and 0 deletions
|
@ -143,6 +143,18 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn first_composites() {
|
||||||
|
assert!(!is_prime(0));
|
||||||
|
assert!(!is_prime(1));
|
||||||
|
|
||||||
|
for (p, q) in primes().zip(primes().skip(1)) {
|
||||||
|
for i in p + 1..q {
|
||||||
|
assert!(!is_prime(i), "{} reported prime", i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn issue_1556() {
|
fn issue_1556() {
|
||||||
// 10 425 511 = 2441 × 4271
|
// 10 425 511 = 2441 × 4271
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue