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.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.