note 41870 added to function.pow
| From: | MattAKAJunkie at rn2 dot php dot net | Date: | Sat, 24 Apr 2004 05:16:26 +0000 |
| Subject: | note 41870 added to function.pow | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-68708@lists.php.net to get a copy of this message | ||
Using pow(), a simplistic n-root function can be made.
<?
// precond: $n = n-root, $num = number to 'n-root'
// postcond: returns $n-root of $num
function n_root($n, $num)
{
return (float) pow($num, (1/$n)); // basic algebra
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.pow.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41870
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41870&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41870&report=yes
Search -- http://master.php.net/manage/user-notes.php