I've seen some errors in my life, but this one caught me by surprise the most.
I have a float column containing 0.02
.
Now i'm trying this query :
select rma.*,120.0/60.0*rma.amount as reward
Now math tells us the result will be 0.04
,
But suprisingly enough MySql (Version 5.5.28) claims otherwise, and says it's :
0.03999999910593033
I've also tried without the .0
with the numbers, and using braces, still same result.
Now the same results happens with all cases of uneven numbers. for example 4.1
will be 8.199999809265137
Anyone knows why that happens?