ChrisVilches/cpdiff

125.499980 == 125.500000 (Wrong answer using error = 3 decimals)

Opened this issue · 0 comments

In this case, using 3 decimals of error, 125.499980 == 125.500000 should be approximate (therefore "Accepted").

I think the problem why this happens is that the current implementation only checks that the digits up to the 3rd decimal are equal, but not that the actual numeric values are within the error, which is significantly harder to implement.

I think one way to solve this problem easily is by doing some processing and isolate the 499, somehow round it to 500 and then perform both (original number and rounded number) checks with the number being compared to.