PATH:
home
/
lab2454c
/
tripvare.com
/
vendor
/
phpoffice
/
phpspreadsheet
/
src
/
PhpSpreadsheet
/
Calculation
/
MathTrig
<?php namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class SeriesSum { /** * SERIESSUM. * * Returns the sum of a power series * * @param mixed $x Input value * @param mixed $n Initial power * @param mixed $m Step * @param mixed[] $args An array of coefficients for the Data Series * * @return float|string The result, or a string containing an error */ public static function evaluate($x, $n, $m, ...$args) { try { $x = Helpers::validateNumericNullSubstitution($x, 0); $n = Helpers::validateNumericNullSubstitution($n, 0); $m = Helpers::validateNumericNullSubstitution($m, 0); // Loop through arguments $aArgs = Functions::flattenArray($args); $returnValue = 0; $i = 0; foreach ($aArgs as $argx) { if ($argx !== null) { $arg = Helpers::validateNumericNullSubstitution($argx, 0); $returnValue += $arg * $x ** ($n + ($m * $i)); ++$i; } } } catch (Exception $e) { return $e->getMessage(); } return $returnValue; } }
[-] Roman.php
[edit]
[-] MatrixFunctions.php
[edit]
[-] Absolute.php
[edit]
[-] Floor.php
[edit]
[-] Angle.php
[edit]
[+]
..
[-] Combinations.php
[edit]
[-] Gcd.php
[edit]
[-] Round.php
[edit]
[-] IntClass.php
[edit]
[-] SeriesSum.php
[edit]
[-] Sign.php
[edit]
[-] Factorial.php
[edit]
[-] Subtotal.php
[edit]
[-] Arabic.php
[edit]
[-] Sum.php
[edit]
[-] Exp.php
[edit]
[-] Logarithms.php
[edit]
[-] Lcm.php
[edit]
[-] Operations.php
[edit]
[-] Helpers.php
[edit]
[-] Base.php
[edit]
[-] Sqrt.php
[edit]
[-] Trunc.php
[edit]
[+]
Trig
[-] Ceiling.php
[edit]
[-] Random.php
[edit]
[-] SumSquares.php
[edit]