Ad
  • Default User Avatar

    In some (but not all) cases, my Java code is calculating X.999999999999 (shown with a print statement), making the answer X based on the kata requirement for the whole number part of the answer, but the tests fail the code saying the expected answer is X+1. As mentioned, this happens only in some cases. In the example test code I get 80.999999999 and the test pass case is 80, so it passes fine. There seems to be a lot of this same issue below, but the standard looks like: 'XX other people did it' and its marked 'resolved'. By changing the variable types to floats I get a little closer due to the loss of precision, but still see failing tests for the same reason. Perhaps the tests should take that precision issue into consideration.