I compute two values x and y. If they are almost equal then - in theory - they should be exacactly equal but because of floating point math they are slightly off. In order to fix this problem I simply round every number in my program and it seems to work. However I became aware that this method could fail if x and y are
x = 1.1234567849999
y = 1.1234567850001
These numbers I surely want to be equal, but if they get rounded to the 8th digit x will go down and y will go up. I don't understand floating point math very well and I want to ask if this is a real danger or if such a case is only a problem in theory that do not occur practise?