I added a snippet that finds the factorial of a positive integer using math.gamma.
Description
This approach is marginally faster than the recursive function. I also made it accept only positive integers, because I believe it has more usability than a normal snippet of the gamma function.
What does your PR belong to?
[ ] Website
[x] Snippets
[ ] General / Things regarding the repository (like CI Integration)
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] Enhancement (non-breaking improvement of a snippet)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have checked that the changes are working properly
[x] I have checked that there isn't any PR doing the same
I added a snippet that finds the factorial of a positive integer using
math.gamma
.Description
This approach is marginally faster than the recursive function. I also made it accept only positive integers, because I believe it has more usability than a normal snippet of the gamma function.
What does your PR belong to?
Types of changes
Checklist: