You are here

public static function PHPExcel_Calculation_MathTrig::SUMSQ in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php \PHPExcel_Calculation_MathTrig::SUMSQ()

* SUMSQ * * SUMSQ returns the sum of the squares of the arguments * * Excel Function: * SUMSQ(value1[,value2[, ...]]) * * @access public * @category Mathematical and Trigonometric Functions *

Parameters

mixed $arg,... Data values: * @return float

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php, line 1242

Class

PHPExcel_Calculation_MathTrig
PHPExcel_Calculation_MathTrig

Code

public static function SUMSQ() {

  // Return value
  $returnValue = 0;

  // Loop through arguments
  foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {

    // Is it a numeric value?
    if (is_numeric($arg) && !is_string($arg)) {
      $returnValue += $arg * $arg;
    }
  }

  // Return
  return $returnValue;
}