Using the pow() function with integers, floats, and both negative and positive numbers. : pow « Math « PHP






Using the pow() function with integers, floats, and both negative and positive numbers.

 
<?php

echo pow(2, 8) . "\n";
echo pow(-2, 5) . "\n";
echo pow(0, 0) . "\n";
echo pow(M_E, 1) . "\n";
echo pow(3.2, 4.5) . "\n";
echo pow(2, -2) . "\n";
echo pow(-2, -3) . "\n";
echo pow(9, 0.5) . "\n";
?>
  
  








Related examples in the same category

1.Using the pow() function with integers, floats, and both negative and positive numbers.
2.number pow ( number base, number exponent), a base and a power to raise it by