Example of pow():
<?phpecho(pow(2,4) . "<br>");echo(pow(-2,4) . "<br>");echo(pow(-2,-4) . "<br> ");echo(pow(-2,-3.2));?>The pow() function returns x raised to the y power.
pow( x,y );
parameter | describe |
---|---|
x | Required. Specifies the base to be used. |
y | Required. Specify index. |
Return value: | x to the power of y. |
---|---|
Return type: | Returns an Integer if possible, a Float otherwise. |
PHP version: | 4+ |
PHP change log: | PHP 4.0.6: Return integer if possible. Previous versions only returned float. PHP 4.2.0: No warning is generated if an error occurs. |