PHP pow() Function
Example
Example of pow():
"); echo(pow(-2,4) . ""); echo(pow(-2,-4) . "
"); 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
);
| Parameters | 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: | Returns an Integer if possible, otherwise a Float. |
| PHP Version: | 4+ |
| PHP Changelog: | PHP 4.0.6: Returns an integer if possible. Earlier versions returned only a float. |
| PHP 4.2.0: No warning is generated if an error occurs. |
PHP Math Reference Manual