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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Should just use decimal since it's a currency kata.
I think we only run into issues if there are translated languages which don't have decimals included then.
original language is C#, there's a (not float) C# decimal literal in the description,
100.00M
and then (mis)translations into float for all other languages
The description explicitly says that the return value should be decimal. Now, there are two options: option one is that by decimal, author meant "fractional, with a decimal dot", and used binary floats - then this is bad, and even comparison with margin is wrong. Another option is that the author meant a proper decimal data type - in such case, rounding is well defined (if rounding mode is known), and exact equality of decimal values is correct.
I did not try to solve so I do not know in what state the kata is now. Since the theme is money, it definitely should be an exact equality of proper decimal values of scale 2 (or functionally equivalent).
this removes the rounding requirement, and the margin might even so be too small for what it seems to try to do
(is there a correct way to apply this requirement? at a glance it looks fubar to me)
Python accepts solutions that don't round to two decimal places.
Should be resolved as tests use approx comparison
Approved
Could you please share the link where I can read more about this solution)
Floating point comparison should be used in
C#
Crystal
Haskell
JS
Ruby
I'm curious why calling Distinct()?
This comment is hidden because it contains spoiler information about the solution
That method returns a string, not a number. Please read the docs. Convert the string to a number.
How do I return the string when the .toFixed method is only work on number?
Loading more items...