sqrt

float sqrt(float num) 

Returns the square root of the given argument.

Returns:

Square root of a number; NAN for negative values

Description:

sqrt() returns the square root of a number. This function returns the string NAN (for Not a Number) when given a negative value in num .

Version:

PHP 3, PHP 4

See also:

pow()

Example:

Calculate the square root of a number
$org = 25; 
echo "The square root of $org is ", sqrt($org); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.