Description Usage Arguments Value References Examples
It is often useful to compute the logarithmic form of the factorial and convert it to exponent form to avoid overflow. The approximation is an alternative approach given by Srinivasa Ramanujan (Ramanujan 1988).
ln n! \approx n ln n - n + \frac{1}{6} ln(n(1 + 4n(1 + 2n))) + \frac{1}{2} ln π
1 | stirlingln(n)
|
n |
desired integer to approximate factorial |
the natural log of the approximated factorial per Stirling's approximation.
Stirling's approximation. (2017, March 8). In Wikipedia, The Free Encyclopedia. From https://en.wikipedia.org/w/index.php?title=Stirling
1 2 | stirlingln(10)
stirlingln(15)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.