BaReinhard / Hacktoberfest-Mathematics

Math is fun so let's make some scripts and or programs that use some of your favorite math formulas and functions.
https://bareinhard.github.io/Hacktoberfest-Mathematics/
GNU General Public License v3.0
122 stars 363 forks source link

Add tail recursive version of the factorial function #641

Open enimiste opened 5 years ago

enimiste commented 5 years ago

This version doesn't causes the StackOverflowException when n is big Long type is used in the return type to avoid int overflow with big multiplications.