Note that bcmath doesn't seem to handle numbers in exponential notation
(i.e. "1e4"), although PHP considers such a value a
number.
example:
$exp1 = "1E5";
$exp2 =
"2E4";
$ans1 = bcadd($exp1, $exp2, 3);
$ans2 = $exp1 +
exp2;
echo("bcadd: $exp1 + $exp2 = $ans1");
echo("php:
$exp1 + $exp2 = $ans2");
// Output:
bcadd: 1E5 + 2E4 =
0.000
php: 1E5 + 2E4 = 120000
Just a gotcha if you're using
passing PHP numbers into bcmath functions...