You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
This function implements a standard algorithm for computing factorials. It may not be the most efficient for very large arguments, but it is very transparent. The function accepts single numbers as inputs or arrays.
Note that for any real work, the code suggested by John D'Errico is actually preferable, because it is faster and more precise. This code is implemented in another file on FEX, logfactorial. I would therefore suggest that you use that function instead of largefactorial.
Cite As
Yvan Lengwiler (2026). Factorial of large numbers (https://www.mathworks.com/matlabcentral/fileexchange/14816-factorial-of-large-numbers), MATLAB Central File Exchange. Retrieved .
Acknowledgements
Inspired: Log of factorial of large numbers
General Information
- Version 1.0.0.0 (3.22 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 | Better documentation.
|
