You need to read floating point numbers. Many decimal numbers do not have an exact representation in binary format, so they will not exactly match.
That's why in comparison, you usually see:
if (abs(ab) < epsilon) { ...
where epsilon is a small value, such as 0.00000001, depending on the required accuracy.
source share