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.
fork approved, issue fixed
Java Fork
deprecated API
warning by removing java.math.BigDecimalOr is there a way to do it in java without using math.round or DecimalFormat?
@siebenschlaefer does this mean that this one can't be completed in java until it is fixed? My quest to finish all the 8kyu in java is going down the drain haha
Not unless the kata explicitly asks you to solve the problem without using this very method.
I could reproduce this issue.
The Java tests use floats for the constants. So the expected value before rounding of
mpgToKPM(4145)
is calculated as1467.35498046875
(instead of1467.35505046589605626650154590606689453125
if doubles were used).@emporio, @AngusJGoldsmith or anyone with write access, please fix this by replacing
in the tests with
But that would really defeat the concept of doing the kata, wouldn't it?
@emporio, I think the solution (in Java) is something along the lines of (where n is a double or float) (n*100)/100.00
Can someone proficient in Java repair this?
Reusing variables is not as clear as possible. And assigning to a reference variable doesn't create a copy.
No, it isn't. If so, you can declare your parameter final.
I just didn't want to add a new String() to make a copy. I wanted it to stay as clear as possible.