pow() function in PHP

PHPProgrammingServer Side Programming

The pow() function Returns a raised to the power of b.

Syntax

pow(a,b)

Parameters

  • a − The base

  • b − The exponent

Return

The pow() function Returns a raised to the power of b.

Example

 Live Demo

<?php
   echo(pow(3,5) . "<br>");
?>

Output

243<br>

Example

Let us see another example −

 Live Demo

<?php
   echo(pow(-4,6) . "<br>");
   echo(pow(-3,-9) . "<br>");
?>

Output

4096<br>-5.0805263425291E-5<br>

Example

Let us see another example −

 Live Demo

<?php
   echo(pow(-4,-5.3));
?>

Output

NAN
raja
Updated on 27-Dec-2019 07:01:25

Advertisements