Stirling

Stirling's approximation to factorials.
2.3K Downloads
Updated 17 Jun 2003

View License

Stirling´s approximation returns the logarithm of the factorial value or the factorial value for n as large as 170 (a greater value returns INF for it exceeds the largest floating point number, e+308). For a better expansion it is used the Kemp (1989) and Tweddle (1984) suggestions.
It needs to input n - can be a fractional or a scalar and o - option of the result (logarithm of the factorial value = 1; factorial value = 2)[default = 2].

Cite As

Antonio Trujillo-Ortiz (2026). Stirling (https://www.mathworks.com/matlabcentral/fileexchange/3600-stirling), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R11
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0.0

It was added an appropriate format to cite this file.