Fixed issue with treating Mersenne's number as valid divisor for p.
This commit is contained in:
1 parent
be92ef1ae3
commit
bfb3bcb1e3
1 file changed
+10
@@ -2192,6 +2192,11 @@ public struct MersenneNumberDivisorByDivisorCpuTesterWithTemplate() : IMersenneN
|
||||
ulong limit64 = (ulong)limit;
|
||||
for (int x = 2; x < 64; x++)
|
||||
{
|
||||
if ((ulong)x == prime)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ulong d = (1UL << x) - 1UL;
|
||||
if (d > limit64)
|
||||
{
|
||||
@@ -2216,6 +2221,11 @@ public struct MersenneNumberDivisorByDivisorCpuTesterWithTemplate() : IMersenneN
|
||||
break;
|
||||
}
|
||||
|
||||
if ((ulong)x == prime)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (BigInteger.ModPow(2, prime, dBig) == BigInteger.One)
|
||||
{
|
||||
divisor = dBig;
|
||||
|
||||
Reference in new issue
Block a user