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 just looked into it and your are right -0 is a thing however unless in string form it has no effect as 0 == -0. As well, this is only the case with floats and the desired return type is an integer. Because in java twos complete is used for integers -0 can't be created for integers.
This comment is hidden because it contains spoiler information about the solution
No, no point.
Is there any point in this because 0 * (-1) == 0?
Yes it was java
Help us help you. Specify in which language you're experiencing this problem.
If this was Java, it has been fixed.
Sample jUnit tests are static they should not be. Causes an error. if this was intentional then well played however kinda cruel to people as many probably believed there code was wrong when it was just a problem with the jUnit.
Switch values on the jUnit tests. expected value is returning claculated value, and actual value is displaying what the expected value was. This is for the Java Kata.
I used BigInteger instead of BigDecimal. DOH! But it worked! "I could have done it in a much more complicated way."
Hi.
The Kata has the requirement : "You need to round the answer upto 2 decimal places and return it as String."
Because of that, 2.4 is not the same as 2.40 (mathematically it is the same value).
The Test expects two decimal places like in the example for 0 - the expectation is "0.00" and not "0" or "0.0".
jUnit expected actual solution set answers appear to be backwards. expected was presenting my calculations, and actual was presenting expected answer. cause a moment of confusion.