note 51460 deleted from function.sqrt by hholzgra
| From: | hholzgra@php.net | Date: | Thu, 02 Aug 2012 15:36:48 +0000 |
| Subject: | note 51460 deleted from function.sqrt by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189880@lists.php.net to get a copy of this message | ||
Note Submitter: chris DOT rutledge AT gmail DOT com
----
Just a note to say you can take the square root of a negative number - it returns an imaginary
number.
One might do it like this
//take initial value of $x
$abs_x = abs($x);
$answer = sqrt($abs_x);
echo $answer;
if ($x < 0) echo"<b><i>i</i></b>";