Doing math with the bcmath extension : BCMath « Math « PHP






Doing math with the bcmath extension

 
<?
$a = bcmul(3.5, bcpow(10, 406));
$b = bcmul(2.8, bcpow(10, 406));

$a_squared = bcpow($a, 2);
$b_squared = bcpow($b, 2);

$hypotenuse = bcsqrt(bcadd($a_squared, $b_squared));

print $hypotenuse;
?>
  
  








Related examples in the same category

1.BCMath Functions