Uses an array of precalculated factorials that are accessed as a lookup table
instead of computing the factorials at runtime. This cuts down on compiled
code bloat (compiler was both unrolling and inlining the computation's loop)
everywhere it was used.
NOTE: The original implementation returned an 'int'. As a result, the largest
uncorrupted factorial it could compute was 12!. For this reason, the lookup
table only goes up to 12!.
Signed-off-by: Peter Mitsis <[email protected]>
Uses an array of precalculated factorials that are accessed as a lookup table
instead of computing the factorials at runtime. This cuts down on compiled
code bloat (compiler was both unrolling and inlining the computation's loop)
everywhere it was used.
NOTE: The original implementation returned an 'int'. As a result, the largest
uncorrupted factorial it could compute was 12!. For this reason, the lookup
table only goes up to 12!.
Signed-off-by: Peter Mitsis <[email protected]>