or you could learn about how to do comparisons with floating point numbers
like multiplying them by the precision that you'd like to compare and comparing them as integers? /s
I had the impression that the usual way to compare floats is to define a precision and check for -p < (a - b) < p. In this case 0.99997 - 1.0002 = -0.00023, which correctly tells us that the two numbers are equal at 0.001 precision and unequal at 0.0001.