note 92175 added to function.bcpow
| From: | thomas at tgohome dot com | Date: | Mon, 13 Jul 2009 07:20:00 +0000 |
| Subject: | note 92175 added to function.bcpow | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158219@lists.php.net to get a copy of this message | ||
<?php
bcscale(100);
/*
* Computes the natural logarithm using a series.
* @author Thomas Oldbury.
* @license Public domain.
*/
function bcln($a, $iter = 10)
{
$result = "0.0";
for($i = 0; $i < $iter; $i++)
{
$pow = (1 + (2 * $i));
$mul = bcdiv("1.0", $pow);
$fraction = bcmul($mul, bcpow(bcsub($a, "1.0") / bcadd($a, "1.0"), $pow));
$result = bcadd($fraction, $result);
}
return bcmul("2.0", $result);
}
?>
----
Server IP: 87.124.35.190
Probable Submitter: 78.146.219.241
----
Manual Page -- http://www.php.net/manual/en/function.bcpow.php
Edit -- https://master.php.net/note/edit/92175
Del: integrated -- https://master.php.net/note/delete/92175/integrated
Del: useless -- https://master.php.net/note/delete/92175/useless
Del: bad code -- https://master.php.net/note/delete/92175/bad+code
Del: spam -- https://master.php.net/note/delete/92175/spam
Del: non-english -- https://master.php.net/note/delete/92175/non-english
Del: in docs -- https://master.php.net/note/delete/92175/in+docs
Del: other reasons-- https://master.php.net/note/delete/92175
Reject -- https://master.php.net/note/reject/92175
Search -- https://master.php.net/manage/user-notes.php