Throw when divisor cycle resolution fails

This commit is contained in:
Marek Lemańczyk committed 2025-10-23 01:48:11 +02:00
1 parent ff9b0122c0
commit c697a7e127
1 file changed
+2 -2
@@ -35,8 +35,8 @@ internal sealed class MersenneCpuDivisorScanSession : IMersenneNumberDivisorByDi
divisorCycle = DivisorCycleCache.Shared.GetCycleLength(divisor); divisorCycle = DivisorCycleCache.Shared.GetCycleLength(divisor);
if (divisorCycle == 0UL) if (divisorCycle == 0UL)
{ {
hits.Clear(); // DivisorCycleCache guarantees a positive cycle for divisors greater than one.
return; throw new InvalidOperationException($"Divisor cycle solver returned zero for divisor {divisor}.");
} }
} }