Computers can't store floating point numbers precisely; they convert them to binary and there are some losses. You know about these losses in decimal, for example what's 3/10 as a number? 0.3333... you cannot represent it in a finite number of digits.

So it is with computers. When you try to store 1.70, the computer converts it into binary which only approximates the true value. So the maths on floating point numbers doesn't work properly. 1.70+0.01 != 1.71.

There are two ways of getting round this. The most accurate way is to switch to integers, and instead of storing 1.70, store 170 with a note somewhere that this is the true value multiplied by 100. Then the maths will be exact.

Or when comparing, you can subtract, take the absolute value and compare the difference with a suitably small number. So if you're comparing 1.70+0.01 with 1.71, what you might do is subtract 1.70 from 1.71 and see if the difference is less than, say, 0.00005.