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.
What I meant here is that inputs like
.52
and6.
are considered valid, which is not immediately obvious. Output of course should be formatted to a well-formed format.The tests now also check for leading/trailing zeros and the code also trims them.
Thank you, it should be fixed now. Let me know if something else must be changed, this is my first kata :)
Random tests often expects incorrectly formatted numbers, such as
032.
->032.0
and.470590
->0.470590
.In fact, there are no considerion about integers and leading/trailing zeroes, so the results can barely be called a decimal number: we don't normally express them as something like
000005.500000
instead of5.5
. (Trailing.0
on integer values is debatable as well.) Or rather, the title should be changed:Double
is a very different beast fromdecimal number
.It is not specified what is considered a valid decimal number.
.52
and6.
are somehow considered valid.Similarly,
null
handling is required but not specified.Fixed invalid number case.
Separated nullity, empty String and invalid numbers in different tests.
Made random test execute 50 times instead of 1.
Java Translation