Home » PHP sqrt() function

PHP sqrt() function

by Online Tutorials Library

PHP sqrt() function

The sqrt() is mathematical function, used to calculate the square root of any number.

Syntax:

Parameter Description Required /Optional
number Specifies a number Required

PHP math Sqrt function

Example1

Output:

Your number is : 625 By Using sqrt function Your number is : 25 

Example2

Output:

Your number is : -9 By using sqrt function Your number is : NAN 

Note: The square root of argument or the special value NAN for negative numbers.

Example 3

Output:

Your number is : 0.09 By using sqrt function Your number is : 0.3 

Example 4

Output:

Your number is : 3 and 4 By using sqrt function (pow(3,2)+pow(4,2)) Your number is : 5 

Next TopicPHP Math

You may also like