Throw when divisor cycle resolution fails
This commit is contained in:
1 parent
ff9b0122c0
commit
c697a7e127
1 file changed
+2
-2
@@ -35,8 +35,8 @@ internal sealed class MersenneCpuDivisorScanSession : IMersenneNumberDivisorByDi
|
||||
divisorCycle = DivisorCycleCache.Shared.GetCycleLength(divisor);
|
||||
if (divisorCycle == 0UL)
|
||||
{
|
||||
hits.Clear();
|
||||
return;
|
||||
// DivisorCycleCache guarantees a positive cycle for divisors greater than one.
|
||||
throw new InvalidOperationException($"Divisor cycle solver returned zero for divisor {divisor}.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user