Precomputed factorial at compile-time #212
Locked
DayDun
started this conversation in
Show and tell
Replies: 1 comment
-
Wow, nice! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Computes the lookup table at compile-time, as opposed to at coding-time 🙃 like the standard library currently does:
Could also compute the overflow bounds at compile-time, which would actually even be a bit practical since
Int
changes size based on the target. But I don't think the standard library has any convenience functions for overflowing arithmetic yet, so I didn't bother.Beta Was this translation helpful? Give feedback.
All reactions