Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php square root

<?php
/*
	The sqrt() function returns square root of a positive float number. 
 	Since square root for negative number is not defined, it returns NAN. 
 	This is one of the most commonly used functions. This function always 
 	returns a floating point number. Eg:
*/
echo(sqrt(0) . "<br>"); // output: 0
echo(sqrt(1) . "<br>"); // output: 1
echo(sqrt(9) . "<br>"); // output: 3
echo(sqrt(0.64) . "<br>"); // output: 0.8
echo(sqrt(-9)); // output: NAN
// I hope this helps!
?>
 
PREVIOUS NEXT
Tagged: #php #square #root
ADD COMMENT
Topic
Name
3+7 =