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.
i don't understand what's being asked of me
Fixed sample tests and updated description in all languages. Though it's still kind of low quality and pretty much a duplicate...
mostly fixed
This should be fixed.
assuming the user reads the unit tests or knows how to read them...
What's the desired precision in JS?
Actually, just use
Test.assertApproxEquals
overNumber
( and check return value type separately ).Rounding is not the correct answer to floating point inaccuracy.
Not really an issue if it's just your preference... You can always delete the comments yourself -- they're not necessary for a valid solution.
I prefer that there are no comments within the function to be worked on
Hi
codeepic
,fixed.
Hi
dnepro
,fixed.
Hi
nbeck
,fixed.
Hi
JohanWiltink
,fixed.
I second that. @swellep good job with the random tests but your test cases should allow for floating point errors in JavaScript. Usually this can be done using
Test.expect()
with a specified error range but since this Kata requires the user to return a string you should probably ask the user to round the result to a number of decimal places before using it in the return string.Loading more items...