Today I came across an funny image shared by codechef on facebook.
A comment was there that it actually worked ! Huh, are you kidding me? Immediately I fired up my command prompt and tried it on my python shell. This got me thinking, was it just python thingy or would it show up on other languages too.
Now, I checked my console on chrome with the following scripts and here are the results.
Now, seriously what the heck man! I have done math wrong all my school life or is this much deeper than that? On digging further, I finally got the logical explaination behind this. (*Remember: There's always a reason for everything :p ). Actually floating point number 0.1 can not be represented exactly in binary floating point representation, there's a marginal round off error. This is usually ignored while most of computation is done. Small bit of idea on this, a robot check tool can actually be developed using the concept.