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.
Details on rounding are not specified w.r.t. breaking ties, and possibly differ between languages.
Updating tests for Crystal was tricky because default rounding mode for
round
changed from half-up to half-even, and fixed tests expected values different than returned by reference solution.The final test should have fixed tests
JS :
JS :
JS :
When you are using concepts which are not trivially known, like unit conversions, m/micro prefixes, it is really necessary to give a calculation unless you want the kata to be about figuring all of that out vs coding (most people won't hence the likely few solutions).
Python, Ruby and Crystal translations kumited, cheers :)
Thanks for translating @donaldsebleung
I think you misread the description. It clearly states to round to the nearest 10 when the result is odd. Since anything to the power of 0 is 1 (which is odd), it is rounded down to 0.
This comment is hidden because it contains spoiler information about the solution
PHP Translation Kumited - please accept :D