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.
Duplicate of (at least) https://www.codewars.com/kata/52fe629e48970ad2bd0007e6
This comment is hidden because it contains spoiler information about the solution
I too suggest using approximate comparisons. The description should openly state that while using
decimal.Decimal
is a best practice in financial calculations to minimize error, it cannot always eliminate it.In my opinion, this kata is an example of financial planning, where the modeling assumptions -- e.g., the assumption of a time-invariant interest rate and a lack of intermediate rounding, as in this kata -- result in a level of inaccuracy that easily dwarfs any issues of round-off errors. However, it's these very modeling assumptions that allow for mathematically elegant solutions that teach us something about the underlying economics. It's only in accounting-like applications where I would insist on absolute lack of round-off error.
For this reason, I would be willing to see a translation in Javascript using ordinary floating-point arithmetic. This would yield more round-off error, but again, it's a minor inaccuracy compared to the underlying, well-intentioned modeling assumptions.
Approved, thanks for another translation.
Approved, thanks for translating.
This comment is hidden because it contains spoiler information about the solution
Approved.
Thanks for translating, but I'm hesitant to approve as
scipy
makes the task quite a bit easier.Thanks, these are now fixed.
Not a bad kata idea per se, but like all katas, this one too requires random tests.
When implementing the random tests, always pass a copy of the input to the function to avoid input manipulation.
Great translation, approved.
This comment is hidden because it contains spoiler information about the solution
Tagged.
This comment is hidden because it contains spoiler information about the solution
.
Loading more items...