瀏覽代碼

big: Default to Frobenius-Underwood. It's 10% faster than Lucas-Selfridge.

Jeroen van Rijn 4 年之前
父節點
當前提交
52da5b8724
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      core/math/big/common.odin

+ 2 - 1
core/math/big/common.odin

@@ -80,7 +80,8 @@ FACTORIAL_BINARY_SPLIT_MAX_RECURSIONS := 100;
 
 
 	Use Frobenius-Underwood for primality testing, or use Lucas-Selfridge (default).
 	Use Frobenius-Underwood for primality testing, or use Lucas-Selfridge (default).
 */
 */
-MATH_BIG_USE_FROBENIUS_TEST :: #config(MATH_BIG_USE_FROBENIUS_TEST, false);
+MATH_BIG_USE_LUCAS_SELFRIDGE_TEST :: #config(MATH_BIG_USE_LUCAS_SELFRIDGE_TEST, false);
+MATH_BIG_USE_FROBENIUS_TEST       :: !MATH_BIG_USE_LUCAS_SELFRIDGE_TEST;
 
 
 /*
 /*
 	Runtime tunable to use Miller-Rabin primality testing only and skip the above.
 	Runtime tunable to use Miller-Rabin primality testing only and skip the above.