pow() function in PHP


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

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 27-Dec-2019

111 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements