note 82389 added to function.pow
| From: | josh at thenullbyte dot org | Date: | Wed, 09 Apr 2008 03:54:21 +0000 |
| Subject: | note 82389 added to function.pow | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138044@lists.php.net to get a copy of this message | ||
Simple function to calculate a sigma:
<?php
/**
* @param int $m lower bound
* @param int $n upper bound
* @param int $i power
*/
function summate($m = 1, $n, $i)
{
while($m <= $n)
{
$sum += pow($m, $i);
++$m;
}
return $sum;
}
echo summate(2, 6, 2);
?>
----
Server IP: 64.71.164.2
Probable Submitter: 68.217.252.143
----
Manual Page -- http://www.php.net/manual/en/function.pow.php
Edit -- https://master.php.net/note/edit/82389
Del: integrated -- https://master.php.net/note/delete/82389/integrated
Del: useless -- https://master.php.net/note/delete/82389/useless
Del: bad code -- https://master.php.net/note/delete/82389/bad+code
Del: spam -- https://master.php.net/note/delete/82389/spam
Del: non-english -- https://master.php.net/note/delete/82389/non-english
Del: in docs -- https://master.php.net/note/delete/82389/in+docs
Del: other reasons-- https://master.php.net/note/delete/82389
Reject -- https://master.php.net/note/reject/82389
Search -- https://master.php.net/manage/user-notes.php