Weird precision issue when subtracting two values

Hi,

I found that I cannot produce the expected results of the following subtraction whenever the difference is small (3 orders of magnitude smaller than the original number, e.g. 0.001 vs 1.001), tested in Igor 6 and also Igor 8:

//This is OK
print/d (1.003-1.001)/2
  0.001
//This is OK
print/d (1.003-1.001)/4
  0.0005

//This is NOT OK
print/d (1.002-1.001)/2
  0.000500000000000056

//Seems like something is not right with a certain subtraction
//This is NOT OK
print/d 1.004-1.003
  0.00100000000000011
print/d 1.003-1.002
  0.00099999999999989
//But then this is OK
print/d 2.003-1.002
  1.001

Is this some limitations of floating point numbers?

Thanks.

Sure. I should have also pointed out the APMath operation which can be used whenever you need arbitrary precision.