-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Avoid extra number conversions #341
Conversation
We don't need BigFloat magic here as Grains.pm will always return bigints. This should fix exercism#239 and exercism#240.
Ok, I am reading #240 comments and see that this is not the correct way to fix tests for exercises. I'll fix the pull request. |
Travis failure fixed in #343. |
I'm not too sure what the problem we're solving is here. If bigint/bignum is removed from Grains.pm, this is the result of the test:
Also, these changes result in doing a string comparison rather than a numeric one. Do you have an example/link to a solution where issues have come up for this? |
The problem to solve is #239. There are examples of problematic solutions that pass the tests there. That issue is old and it had been fixed at one point but then regressed and is relevant for the current master. My change removes BigFloat from the test code and relies on the Grains.pm having "use bigint" and always returning bigints -- and now I see the problem, this is not present in the stub which I incorrectly assumed. |
Ah yes I see what's happened.
|
Thanks @kappa! |
We don't need BigFloat magic here as Grains.pm will always return bigints.
This should fix #239 and #240.