PHP sqrt

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

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

php-math-abc()

Example : +

  1. echo sqrt(100);  

  2. echo'
    ';  

  3. echo sqrt(999);  

  4. echo'
    ';  

  5. echo sqrt(2.25);  

  6. echo'
    ';  

  7. ?>  

Output :

10
31.606961258558
1.5