How to use sqrt in PHP

This article describe about sqrt() function in PHP.
  • 1622

sqrt() function

This function return the square of given number.

Syntax

sqrt(x)

 

Parameter Description
x Required. A number

Note: This function return -1.#IND if parameter is negative.

Example

<html>
<body>
<?php
echo(sqrt(0) . "<br />");
echo(sqrt(1) . "<br />");
echo(sqrt(9) . "<br />");
echo(sqrt(0.64) . "<br />");
echo(sqrt(-9))
?>
</body>
</html>

Output

sqrt-php.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.