ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SeriesSum.php
Go to the documentation of this file.
1<?php
2
4
7
9{
22 public static function evaluate($x, $n, $m, ...$args)
23 {
24 try {
28
29 // Loop through arguments
30 $aArgs = Functions::flattenArray($args);
31 $returnValue = 0;
32 $i = 0;
33 foreach ($aArgs as $argx) {
34 if ($argx !== null) {
36 $returnValue += $arg * $x ** ($n + ($m * $i));
37 ++$i;
38 }
39 }
40 } catch (Exception $e) {
41 return $e->getMessage();
42 }
43
44 return $returnValue;
45 }
46}
$n
Definition: RandomTest.php:85
An exception for terminatinating execution or to throw for unit testing.
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
Definition: Functions.php:583
static validateNumericNullSubstitution($number, $substitute)
Validate numeric, but allow substitute for null.
Definition: Helpers.php:51
static evaluate($x, $n, $m,... $args)
SERIESSUM.
Definition: SeriesSum.php:22
$x
Definition: complexTest.php:9
$i
Definition: disco.tpl.php:19