Add divisor-mode detailed check coverage for factors

This commit is contained in:
Marek Lemańczyk committed 2025-09-17 19:02:21 +02:00
1 parent b1c29ad16e
commit 1b28584168
7 files changed
+465 -224

No files matched your search

@@ -24,8 +24,18 @@ public class MersenneNumberResidueCpuTesterTests
private static void RunCase(MersenneNumberResidueCpuTester tester, ulong exponent, ulong maxK, bool expectedPrime)
{
bool isPrime = true;
tester.Scan(exponent, (UInt128)exponent << 1, LastDigitIsSeven(exponent), (UInt128)maxK, ref isPrime);
bool exhausted = false;
tester.Scan(
exponent,
(UInt128)exponent << 1,
LastDigitIsSeven(exponent),
(UInt128)maxK,
1UL,
(UInt128)maxK,
ref isPrime,
ref exhausted);
isPrime.Should().Be(expectedPrime);
exhausted.Should().BeTrue();
}
}
@@ -27,8 +27,18 @@ public class MersenneNumberResidueGpuTesterTests
private static void RunCase(MersenneNumberResidueGpuTester tester, ulong exponent, ulong maxK, bool expectedPrime)
{
bool isPrime = true;
tester.Scan(exponent, (UInt128)exponent << 1, LastDigitIsSeven(exponent), (UInt128)maxK, ref isPrime);
bool exhausted = false;
tester.Scan(
exponent,
(UInt128)exponent << 1,
LastDigitIsSeven(exponent),
(UInt128)maxK,
1UL,
(UInt128)maxK,
ref isPrime,
ref exhausted);
isPrime.Should().Be(expectedPrime);
exhausted.Should().BeTrue();
}
}