Thanks for the information. I thought it would consider the floating point error the same way on both sides of the equation so I thought it was a bug as for some cases worked and some did not.
If I am looking for values with decimals on tables, how do I bypass this error? Is there a smart way or I need to check if the value is within value+- 10*eps for example?
The usual approach is to include a tolerance, something like this (using the requested criterion of 10*eps) —
TF1 = (28.15e-3 - 28.15/1000) == 0
TF1 = logical
0
TF2 = (28.15e-3 - 28.15/1000) <= 10*eps
TF2 = logical
1
So instead of testing for equality, do essentially the same thing with a subtraction, test it against the criterion, and return a logical value result.
I think the abs() is needed because one quantized expression could be above or below the other quantized expression, and I don't think you'd know which it will be in general.