You are dealing with the natural inaccuracy of binary floating point numbers. Your number amay be 5.5999999999999996, and your result bmay be 5.6000000000000005, which are not equal.
In fact, this is the same calculation as Python:
>>> 5.6
5.5999999999999996
>>> 14 * 0.4
5.6000000000000005
This behavior is common to all binary floating point implementations.
source
share