diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-28 12:16:08 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-28 12:16:08 +0200 |
| commit | 9b248f3b46d5dc0e9522ed264ef71e422a5bc5a5 (patch) | |
| tree | d91742feaf4078d1e35cfcf22f80bddfc9037daf /src/utils/constants.h | |
| parent | 08d524292beed48d8a383acaee96f68cb2bd1cab (diff) | |
| download | nissy-core-9b248f3b46d5dc0e9522ed264ef71e422a5bc5a5.tar.gz nissy-core-9b248f3b46d5dc0e9522ed264ef71e422a5bc5a5.zip | |
Hardcoded factorial constants
Diffstat (limited to 'src/utils/constants.h')
| -rw-r--r-- | src/utils/constants.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/utils/constants.h b/src/utils/constants.h index da0a813..e328a4c 100644 --- a/src/utils/constants.h +++ b/src/utils/constants.h | |||
| @@ -11,6 +11,22 @@ | |||
| 11 | 11 | ||
| 12 | #define UINT8_ERROR UINT8_MAX | 12 | #define UINT8_ERROR UINT8_MAX |
| 13 | 13 | ||
| 14 | STATIC int64_t factorial[FACTORIAL_MAX+1] = { | ||
| 15 | [0] = 1, | ||
| 16 | [1] = 1, | ||
| 17 | [2] = 2, | ||
| 18 | [3] = 6, | ||
| 19 | [4] = 24, | ||
| 20 | [5] = 120, | ||
| 21 | [6] = 720, | ||
| 22 | [7] = 5040, | ||
| 23 | [8] = 40320, | ||
| 24 | [9] = 362880, | ||
| 25 | [10] = 3628800, | ||
| 26 | [11] = 39916800, | ||
| 27 | [12] = 479001600, | ||
| 28 | }; | ||
| 29 | |||
| 14 | STATIC int64_t binomial[12][12] = { | 30 | STATIC int64_t binomial[12][12] = { |
| 15 | {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, | 31 | {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
| 16 | {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, | 32 | {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
