Search limit for divisor sets made configurable
This commit is contained in:
1 parent
a63bc6ac06
commit
1b1697d4da
2 files changed
+5
-5
No files matched your search
@@ -88,8 +88,8 @@ public class ProgramTests
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Program.IsEvenPerfectCandidate(11UL).Should().BeFalse();
|
Program.IsEvenPerfectCandidate(11UL, 32).Should().BeFalse();
|
||||||
Program.IsEvenPerfectCandidate(5UL).Should().BeTrue();
|
Program.IsEvenPerfectCandidate(5UL, 32).Should().BeTrue();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -623,7 +623,7 @@ internal static class Program
|
|||||||
Console.WriteLine($"Testing {p}");
|
Console.WriteLine($"Testing {p}");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isPerfect = IsEvenPerfectCandidate(p, out bool searchedMersenne, out bool detailedCheck);
|
bool isPerfect = IsEvenPerfectCandidate(p, divisorCyclesSearchLimit, out bool searchedMersenne, out bool detailedCheck);
|
||||||
PrintResult(p, searchedMersenne, detailedCheck, isPerfect);
|
PrintResult(p, searchedMersenne, detailedCheck, isPerfect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -949,9 +949,9 @@ internal static class Program
|
|||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
internal static bool IsEvenPerfectCandidate(ulong p)
|
internal static bool IsEvenPerfectCandidate(ulong p, int divisorCyclesSearchLimit)
|
||||||
{
|
{
|
||||||
return IsEvenPerfectCandidate(p, out _, out _);
|
return IsEvenPerfectCandidate(p, divisorCyclesSearchLimit, out _, out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool IsEvenPerfectCandidate(ulong p, int divisorCyclesSearchLimit, out bool searchedMersenne, out bool detailedCheck)
|
internal static bool IsEvenPerfectCandidate(ulong p, int divisorCyclesSearchLimit, out bool searchedMersenne, out bool detailedCheck)
|
||||||
|
|||||||
Reference in new issue
Block a user