Calculates integrational sum of Formula within the Interval by using Sampling Nodes.
@access		public
@return		mixed
557506
public function integrate()
	{
		$sum		= 0;
		$nodes		= $this->getSamplingNodes();
		$distance	= $this->getNodeDistance();
		$sum		+= $this->formula->getValue( array_pop( $nodes ) );
		$sum		+= $this->formula->getValue( array_shift ( $nodes ) );
		foreach( $nodes as $node )
			$sum += 2 * $this->formula->getValue( $node );
		$sum = $sum * $distance / 2;
		return $sum;			
	}
312030
public function end()
    {
        # Calculate the Beginning + The maximum amount of results
        $calc = $this->start() + $this->max;

        # Only return this if it is not above the total otherwise return our maximum
        # example, 24 + 6 = 30, but with only 26 reselts it will display the total results istead (26)
        $r = ($calc > $this->total) ? $this->total : $calc;

        # return the result
        return $r;
    }
893678
private function calculate()
    {
        $this->second = 0;

        $iters = 0;
        $maxIters = 100;
        while ($iters < $maxIters && !$this->satisfied()) {
            if ($this->params->minute !== '*' && ($this->minute != $this->params->minute)) {
                if ($this->minute > $this->params->minute) {
                    $this->modify('+1 hour');
                }

                $this->minute = $this->params->minute;
            }

            if ($this->params->hour !== '*' && ($this->hour != $this->params->hour)) {
                if ($this->hour > $this->params->hour) {
                    $this->modify('+1 day');
                }

                $this->hour = $this->params->hour;
                $this->minute = 0;
            }

            if ($this->params->week !== '*' && ($this->week != $this->params->week)) {
                $this->week = $this->params->week;
                $this->hour = 0;
                $this->minute = 0;
            }

            if ($this->params->day !== '*' && ($this->day != $this->params->day)) {
                if ($this->day > $this->params->day) {
                    $this->modify('+1 month');
                }

                $this->day = $this->params->day;
                $this->hour = 0;
                $this->minute = 0;
            }

            if ($this->params->month !== '*' && ($this->month != $this->params->month)) {
                if ($this->month > $this->params->month) {
                    $this->modify('+1 year');
                }

                $this->month = $this->params->month;
                $this->day = 1;
                $this->hour = 0;
                $this->minute = 0;
            }

            ++$iters;
        }
    }
558483
public function getValue()
    {
        $total = 0;

        foreach ($this->values as $value) {
            $total = $total + $value;
        }

        return $total;
    }
972240
protected function getMinValue()
    {
        $minValue = $this->getFilter()->getMinValue();

        if ($this->isManualCalculation() && ($this->getStepValue() > 0)) {
            $stepValue = $this->getStepValue();
            $minValue  = floor($minValue / $stepValue) * $stepValue;
        }

        return $minValue;
    }
1191407
protected function calculateImplicit()
    {
        /** @var string[][] $explicit List of all items that have been explicitly added to this ChangeSet */
        $explicit = [];

        /** @var string[][] $referenced List of all items that are "referenced" by items in $explicit */
        $referenced = [];

        /** @var string[][] $references List of which explicit items reference each thing in referenced */
        $references = [];

        /** @var ChangeSetItem $item */
        foreach ($this->Changes()->filter(['Added' => ChangeSetItem::EXPLICITLY]) as $item) {
            $explicitKey = $this->implicitKey($item);
            $explicit[$explicitKey] = true;

            foreach ($item->findReferenced() as $referee) {
                try {
                    /** @var DataObject $referee */
                    $key = $this->implicitKey($referee);

                    $referenced[$key] = [
                        'ObjectID' => $referee->ID,
                        'ObjectClass' => $referee->baseClass(),
                    ];

                    $references[$key][] = $item->ID;

                    // Skip any bad records
                } catch (UnexpectedDataException $e) {
                }
            }
        }

        /** @var string[][] $explicit List of all items that are either in $explicit, $referenced or both */
        $all = array_merge($referenced, $explicit);

        /** @var string[][] $implicit Anything that is in $all, but not in $explicit, is an implicit inclusion */
        $implicit = array_diff_key($all, $explicit);

        foreach ($implicit as $key => $object) {
            $implicit[$key]['ReferencedBy'] = $references[$key];
        }

        return $implicit;
    }
1108339
public static function SumTablix($a){
        $result = 0;
        for ($i = 0; $i < count($a); $i++) {
            $result=$result+$a[$i];
        }
        return $result;
    }
744059
public function intVal(): int
    {
        if (!isset($this->_intNum)) {
            $num = gmp_init($this->_num, 10);
            if (gmp_cmp($num, $this->_intMaxGmp()) > 0) {
                throw new \RuntimeException("Integer overflow.");
            }
            if (gmp_cmp($num, $this->_intMinGmp()) < 0) {
                throw new \RuntimeException("Integer underflow.");
            }
            $this->_intNum = gmp_intval($num);
        }
        return $this->_intNum;
    }
1056340
private function bSlope() {
        return (float) (($this->sumXY($this->data) / $this->count) - 
        (($this->sum($this->xVector) / $this->count) * 
        ($this->sum($this->yVector) / $this->count))) / 
        $this->dispersion('x');
    }
822633
public function getUnhealedFreshOrdinaryWoundsSum(): int
    {
        return \array_sum(
            \array_map(
                function (OrdinaryWound $ordinaryWound) {
                    return $ordinaryWound->getValue();
                },
                $this->getUnhealedFreshOrdinaryWounds()
            )
        );
    }
389159
private function computeCoefficients(): void
    {
        $samplesMatrix = $this->getSamplesMatrix();
        $targetsMatrix = $this->getTargetsMatrix();

        $ts = $samplesMatrix->transpose()->multiply($samplesMatrix)->inverse();
        $tf = $samplesMatrix->transpose()->multiply($targetsMatrix);

        $this->coefficients = $ts->multiply($tf)->getColumnValues(0);
        $this->intercept = array_shift($this->coefficients);
    }
539595
public static function IMSUM() {
		// Return value
		$returnValue = self::_parseComplex('0');
		$activeSuffix = '';

		// Loop through the arguments
		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
		foreach ($aArgs as $arg) {
			$parsedComplex = self::_parseComplex($arg);

			if ($activeSuffix == '') {
				$activeSuffix = $parsedComplex['suffix'];
			} elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) {
				return PHPExcel_Calculation_Functions::VALUE();
			}

			$returnValue['real'] += $parsedComplex['real'];
			$returnValue['imaginary'] += $parsedComplex['imaginary'];
		}

		if ($returnValue['imaginary'] == 0.0) { $activeSuffix = ''; }
		return self::COMPLEX($returnValue['real'],$returnValue['imaginary'],$activeSuffix);
	}
820439
public function getNettoSum()
    {
        $dSum = 0;
        foreach ($this->_aList as $oPrice) {
            $dSum += $oPrice->getNettoPrice();
        }

        return $dSum;
    }
1043887
public double Function1D(double x) {
        double frequency = initFrequency;
        double amplitude = initAmplitude;
        double sum = 0;

        // octaves
        for (int i = 0; i < octaves; i++) {
            sum += SmoothedNoise(x * frequency) * amplitude;

            frequency *= 2;
            amplitude *= persistence;
        }
        return sum;
    }
1265625
private function calc()
    {
        $this->limitOffset = max((int)(($this->page - 1) * $this->count), 0);
        $this->limitEndOffset = $this->limitOffset + $this->count;
    }
1130650
public function calculateTotal()
    {
        $this->calculateAdjustmentsTotal();

        $this->total = ($this->quantity * $this->unitPrice) + $this->adjustmentsTotal;

        if ($this->total < 0) {
            $this->total = 0;
        }

        return $this;
    }
586358
protected function getTotal()
	{
		if (null == $this->_total) {
			$this->_total = 0;
			foreach ($this->types as $type) {
				if (isset($type['value'])) {
					$this->_total += $type['value'];
				}
			}
		}
		return $this->_total;
	}