IsPrime with cancellation token removed.

This commit is contained in:
mlemanczyk committed 2025-10-29 22:31:28 +01:00
1 parent f9504a6a19
commit fc5700f82c
11 files changed
+287 -314

No files matched your search

+1 -8
View File
@@ -77,10 +77,8 @@ public sealed class HeuristicPrimeTester
public static HeuristicPrimeTester Exclusive => _tester ??= new();
public bool IsPrimeCpu(ulong n, CancellationToken ct)
public bool IsPrimeCpu(ulong n)
{
ct.ThrowIfCancellationRequested();
byte nMod10 = (byte)n.Mod10();
ulong maxDivisorSquare = ComputeHeuristicDivisorSquareLimit(n);
@@ -93,11 +91,6 @@ public sealed class HeuristicPrimeTester
return HeuristicTrialDivisionCpu(n, maxDivisorSquare, nMod10, includeGroupB);
}
public bool IsPrimeCpu(ulong n)
{
return IsPrimeCpu(n, CancellationToken.None);
}
public bool IsPrimeGpu(ulong n)
{
byte nMod10 = (byte)n.Mod10();