-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Naive factorial implementation #6
Comments
The Second problem has already been solved) |
Can you elaborate on the first point please? |
Just google for "efficient factorial algorithm". |
Thanks) I'll do it |
I found more efficient algorithms for factorial, but I couldn't implement it. |
I implemented an efficient algorithm (from google guava library) |
The current implementation of factorial has two problems:
Int
, hence it is correct only in [ 0 .. 12 ] range.Even using
ULong
will allow values only from 0 to 20 inclusively, so only long arithmetic can have any practical value because for standard integer types the optimal algorithm is just to access array:The text was updated successfully, but these errors were encountered: