PHP pow() Function Example

PHP pow() Function Example


Posted in : PHP Posted on : January 28, 2011 at 5:32 PM Comments : [ 0 ]

The pow() function is function in php that generate the result of the first argument to the power of the second argument.

PHP pow() Function Example:

The pow() function is function in php that generate the result of the first argument to the power of the second argument.

Syntax:

pow(base, power)

where base number is the base that multiply itself the given power times.

Example:

<?php
echo pow(20, 3) . "<br />";
echo pow(-20, 3) . "<br />";
echo pow(2, 4.2) . "<br />";
echo pow(-2, 4.2);
?>

Output:

The output of this example is:

8000
-8000
18.379173679953
NAN

Download Example Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics