Home > Article > Backend Development > How to use php sqrt function
PHP sqrt() means square root, that is, finding the square root of the parameters. The syntax is sqrt(X). where X represents the number for which the square root is to be taken.
#What does the sqrt function mean? How to use php sqrt function?
Function: Find the square root of the parameters.
Syntax:
sqrt(X)
Parameters: X represents the number for square root calculation.
Description: Returns the result of the square root of parameter X.
php sqrt() function usage example:
<?php $i = 9; $i = sqrt($i); $j = 8; $j = sqrt($j); $k = -5; $k = sqrt($k); echo $i."*****".$j."*****".$k; ?>
Output:
3*****2.8284271247462*****NAN
This article is an introduction to the PHP sqrt function. I hope it will help you if you need Friends help!
The above is the detailed content of How to use php sqrt function. For more information, please follow other related articles on the PHP Chinese website!