Modulo operators replaced with steppers, where possible.

This commit is contained in:
mlemanczyk committed 2025-12-08 20:57:47 +01:00
1 parent 475507ce0c
commit f7dbc017a9
15 files changed
+531 -151

No files matched your search

+12 -12
View File
@@ -307,19 +307,19 @@ internal static partial class PrimeOrderCalculator
{
UInt128 primeFactor = span[i].Value;
UInt128 reduced = order;
for (int iteration = 0; iteration < span[i].Exponent; iteration++)
{
if ((reduced % primeFactor) != UInt128.Zero)
{
break;
}
for (int iteration = 0; iteration < span[i].Exponent; iteration++)
{
if (reduced.ReduceCycleRemainder(primeFactor) != UInt128.Zero)
{
break;
}
reduced /= primeFactor;
if (Pow2ModWideGpu(gpu, reduced, prime, divisorData) == UInt128.One)
{
return false;
}
}
reduced /= primeFactor;
if (Pow2ModWideGpu(gpu, reduced, prime, divisorData) == UInt128.One)
{
return false;
}
}
}
return true;