PHP: sqrt() function
Description
The sqrt() function is used to create a square root of a number.
Version:
(PHP 4 and above)
Syntax:
sqrt(num)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
num | The specified number. | Required | Float |
Return value
The square root of num.
Value Type: Float.
Pictorial Presentation
Example:
<?php
echo sqrt(100);
echo'<br>';
echo sqrt(999);
echo'<br>';
echo sqrt(2.25);
echo'<br>';
?>
Output:
10 31.606961258558 1.5
View the example in the browser
See also
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/php/function-reference/sqrt.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics