mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 20:47:46 +00:00
factor: Add test exhibiting a bug in ρ
The test is repeated 20 times to make it overwhelmingly-likely to fail (the bug itself is only triggered rarely)
This commit is contained in:
parent
3a90e31307
commit
9eb944b6b9
1 changed files with 8 additions and 0 deletions
|
@ -156,4 +156,12 @@ mod tests {
|
|||
.map(|i| 2 * i + 2u64.pow(32) + 1)
|
||||
.all(|i| factor(i).product() == i));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn factor_recombines_strong_pseudoprime() {
|
||||
let pseudoprime = 17179869183;
|
||||
for _ in 0..20 {
|
||||
assert!(factor(pseudoprime).product() == pseudoprime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue