Home  >  Article  >  Backend Development  >  How to use pow function

How to use pow function

藏色散人
藏色散人Original
2019-01-30 10:33:5359832browse

PHP pow function represents exponential expression.

How to use pow function

#How to use the pow function?

php pow() function syntax

Function: The function of pow() function is to calculate a number to the nth power and return it

Syntax:

pow(X,Y);

Parameters:

X represents the number to be processed

Y represents the n value in the specified n power

Description: Returns the Y power of Power, if the parameters are correct, the function will return a numerical value. If it cannot be calculated, it will return NAN.

php pow() function usage example:

<?php
$i = 5;
$i = pow($i,3);
$j = 6.5;
$j = pow($j,4);
$k = -5;
$k = pow($k,5);
$h = -0.5;
$h = pow($h,0.6);
echo $i."*****".$j."*****".$k."*****".$h;
?>

Output:

125*****1785.0625*****-3125*****NAN

This article is an introduction to the PHP pow function. I hope it will help you if you need Friends help!

The above is the detailed content of How to use pow function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn