PHP pow() Function
Definition and Usage
The pow() function returns x to the power of y.
Syntax
pow(x,y)
Parameter | Description |
---|---|
x | Required. A number. |
y | Required. A number. |
Description
returns x of y Power of power. If possible, this function will return an integer.
If the power cannot be calculated, a warning will be issued, pow() will return false. Starting from PHP 4.2.0, pow() does not generate any warnings.
Example
<?php echo pow(4,2); echo pow(6,2); echo pow(-6,2); echo pow(-6,-2); echo pow(-6,5.5); ?>
Output similar to:
16 36 36 0.0277777777778 -1.#IND