From 9b248f3b46d5dc0e9522ed264ef71e422a5bc5a5 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 28 Jul 2025 12:16:08 +0200 Subject: Hardcoded factorial constants --- src/utils/constants.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/utils/constants.h') 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 @@ #define UINT8_ERROR UINT8_MAX +STATIC int64_t factorial[FACTORIAL_MAX+1] = { + [0] = 1, + [1] = 1, + [2] = 2, + [3] = 6, + [4] = 24, + [5] = 120, + [6] = 720, + [7] = 5040, + [8] = 40320, + [9] = 362880, + [10] = 3628800, + [11] = 39916800, + [12] = 479001600, +}; + STATIC int64_t binomial[12][12] = { {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -- cgit v1.3