We all know that dealing with float point numbers may meet troubles like this:
echo intval(0.58*100);//57
And using bcmath functions will help:
echo bcmul('0.58', '100', 2);//58.00
php manual:
//Multiply the left_operand by the right_operand.
string bcmul(string $left_operand , string $right_operand [, int $scale = 0 ])
But why will this work?
I noticed that the first two parameters should be string, I wonder if this is because these functions deal with numbers in string way?