big: Add factorial, have tests use hex strings.

This commit is contained in:
Jeroen van Rijn
2021-08-11 20:59:52 +02:00
parent db0196abc7
commit e80ac18324
7 changed files with 201 additions and 135 deletions
+6
View File
@@ -11,6 +11,11 @@ package big
import "core:intrinsics"
/*
TODO: Make the tunables runtime adjustable where practical.
This allows to benchmark and/or setting optimized values for a certain CPU without recompiling.
*/
/*
Tunables
*/
@@ -21,6 +26,7 @@ when _LOW_MEMORY {
_DEFAULT_DIGIT_COUNT :: 32;
}
_MUL_KARATSUBA_CUTOFF :: #config(MUL_KARATSUBA_CUTOFF, _DEFAULT_MUL_KARATSUBA_CUTOFF);
_SQR_KARATSUBA_CUTOFF :: #config(SQR_KARATSUBA_CUTOFF, _DEFAULT_SQR_KARATSUBA_CUTOFF);
_MUL_TOOM_CUTOFF :: #config(MUL_TOOM_CUTOFF, _DEFAULT_MUL_TOOM_CUTOFF);