big: Add internal_int_is_prime.

This commit is contained in:
Jeroen van Rijn
2021-09-02 18:31:08 +02:00
parent e639c61499
commit 31918d3b8f
8 changed files with 299 additions and 18 deletions
+11
View File
@@ -75,6 +75,17 @@ FACTORIAL_MAX_N := 1_000_000;
FACTORIAL_BINARY_SPLIT_CUTOFF := 6100;
FACTORIAL_BINARY_SPLIT_MAX_RECURSIONS := 100;
/*
`internal_int_is_prime` switchables.
Use Frobenius-Underwood for primality testing, or use Lucas-Selfridge (default).
*/
MATH_BIG_USE_FROBENIUS_TEST :: #config(MATH_BIG_USE_FROBENIUS_TEST, false);
/*
Runtime tunable to use Miller-Rabin primality testing only and skip the above.
*/
USE_MILLER_RABIN_ONLY := false;
/*
We don't allow these to be switched at runtime for two reasons: