ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
SeriesSum.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
PhpOffice\PhpSpreadsheet\Calculation\MathTrig
;
4
5
use
PhpOffice\PhpSpreadsheet\Calculation\Exception
;
6
use
PhpOffice\PhpSpreadsheet\Calculation\Functions
;
7
8
class
SeriesSum
9
{
22
public
static
function
evaluate
(
$x
,
$n
,
$m
, ...$args)
23
{
24
try
{
25
$x
=
Helpers::validateNumericNullSubstitution
(
$x
, 0);
26
$n
=
Helpers::validateNumericNullSubstitution
(
$n
, 0);
27
$m
=
Helpers::validateNumericNullSubstitution
(
$m
, 0);
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) {
35
$arg =
Helpers::validateNumericNullSubstitution
($argx, 0);
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
}
PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers\validateNumericNullSubstitution
static validateNumericNullSubstitution($number, $substitute)
Validate numeric, but allow substitute for null.
Definition:
Helpers.php:51
PhpOffice\PhpSpreadsheet\Calculation\Functions\flattenArray
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
Definition:
Functions.php:583
$m
$m
Definition:
show_metadata.php:25
$n
$n
Definition:
RandomTest.php:85
Exception
PhpOffice\PhpSpreadsheet\Calculation\MathTrig
Definition:
Absolute.php:3
$i
$i
Definition:
disco.tpl.php:19
Functions
php
$x
$x
Definition:
complexTest.php:9
PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SeriesSum
Definition:
SeriesSum.php:8
PhpOffice\PhpSpreadsheet\Calculation\MathTrig\SeriesSum\evaluate
static evaluate($x, $n, $m,... $args)
SERIESSUM.
Definition:
SeriesSum.php:22
Exception
libs
composer
vendor
phpoffice
phpspreadsheet
src
PhpSpreadsheet
Calculation
MathTrig
SeriesSum.php
Generated on Thu Jan 16 2025 19:01:45 for ILIAS by
1.8.13 (using
Doxyfile
)