Factorial overflow

I&rsquo;ve been working on a statistics library in Typst recently, distro . One fun outcome of this has been the chance to revisit some special functions in mathematics, and explore how to implement them in a numerically safe way. For instance, Typst uses i64 under the hood when implementing the calc.binom function, and it overflows for moderately large n ( Issue #4993 ). Now, the factorial…