Although the topic isn't quite new and relevant, I cannot figure out one thing.
When I use Python 2.7.8 (x86) IDLE on x64 Windows 7, Intel core i5 760, I found that my machine has odds in multiplying particular float/double numbers, but not all of them!
>>> print 0.01 == 0.1 * 0.1
False
>>> print (1/10.0) ** 2 == 0.01
False
>>> print 0.01 - 0.1 ** 2
-1.73472347598e-18
BUT:
>>> print 1/10.0 * 1/10.0 == 0.01
True
>>> print 0.015 == 0.05 * 0.3
True
>>> print 0.0002 == 0.01 * 0.02
True
>>> print 0.0001 == 0.01 * 0.01
True
... (and so on. Always true.)
(!) I am not talking about such difficult (for PC and... for me) operations like taking in power, log, exp. I'm talking about multiplying, divison, adding and substracting.
I read this and this to dive deeply. It says that actually using comparisons such like 1.1 == 1.1 can lead to false. In my case, it is not. Thus, my computer rounds this float representations into the same bits represetations.
Using Java 7 with Eclipse compiler gives me the same results. Thus, I can conclude that the result in my case depends only on my machine epsilone (register precision), which is less than 1.734723475976807e-18, but not on compiler and programming environment.
The question is why my machine fails to compare 0.01 == 0.1 * 0.1 whereas causing no disrepancy with other multiplying examples (I tried a lot to confuse my PC!) ?