Home  >  Article  >  Backend Development  >  How to use php sqrt function

How to use php sqrt function

藏色散人
藏色散人Original
2019-01-30 10:20:398359browse

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.

How to use php sqrt function

#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!

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

Related articles

See more