X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP pow() Function

PHP Math Reference PHP Math Reference

Example

Examples of pow():

<?php
echo(pow(2,4) . "<br>");
echo(pow(-2,4) . "<br>");
echo(pow(-2,-4) . "<br>");
echo(pow(-2,-3.2));
?>

Run example »

Definition and Usage

The pow() function returns x raised to the power of y.


Syntax

pow(x,y);

Parameter Description
x Required. Specifies the base to use
y Required. Specifies the exponent

Technical Details

Return Value: x raised to the power of y
Return Type:  Integer if possible, Float otherwise
PHP Version: 4+
PHP Changelog: PHP 4.0.6: Will now return integer if possible. Earlier it only returned float
PHP 4.2.0: No warning is issued on errors


PHP Math Reference PHP Math Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook