Why would on earth PHP convert the result of (int) ((0.1+0.7)*10) to 7, not 8? I know that the result will be (float) 8 when it’s cast to (int) the result will be 7? Why does that happen?
Why would on earth PHP convert the result of (int) ((0.1+0.7)*10) to 7, not
Share
It is all about
float. See PHP: Floating point numbers:Additional reading: