Skip to content
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

Declare factorial as returning a float in order to fix issue 74 #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gjcarrette
Copy link

@gjcarrette gjcarrette commented Apr 5, 2023

It works perfectly fine to have the factorial function in Scorer.php to be declared as returning a float.
This results in the same output as before, and extends the code to work with longer strings.
It is valid because the value of $pi is a float and it will cause the value of $g to become a float no matter if factorial returns an int or a float. I hope I am not being too lazy or naive here.

Note that if you use really really huge passwords you can exceed runtime limits, but that is another issue, out of scope here.
You can experiment with ulimit -t 300 if you wish.

Proposed fix for #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant