Topic: Strangest bug I've ever since
I don't know how to explain this. I'm still confused with this bug. I have some strange bug and I'm trying to debugging until I found the root problem. I've just try some simple substraction but it gives me strange result. Here is my code:
$x = 0.56*1.5;
logger($x-0.84);
What I expection is 0, but the result is : 1.1102230246252E-16
If you want to know what is logger function, it's some function that I create to echo the parameter. The stranger thing is, this bug only happen to 2 decimal place operation. If I try with
$x = 0.5*1.5;
logger($x-0.75);
It works fine. I already check the variable type. Both show me they are double. Can anyone hlep me?