Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Also description is inconsistent here:
These are for all languages except JavaScript
This is for JavaScript
All-in-all, the rounding requirement should be removed for all languages (in-accordance with issue below) and replaced with the description in JavaScript
This comment is hidden because it contains spoiler information about the solution
All languages should follow Java by using approximate equality comparison when writing custom tests
fork approved, issue fixed
That's because 2.35 is the conversion factor from mpg to kpl of a US gallon. The kata is specifically asking about imperial gallons, which are larger than US gallons. It's better to just use the numbers provided in the kata rather than search online for a conversion factor anyway, otherwise you are likely to run into rounding errors.
in python, this doesn't work...
return mpg / 2.35
10 - 4.25 (rounded) - expected 3.54
typed on calculator, got 4.25 (again rounded)