You are here

public static function PHPExcel_Calculation_Engineering::ERF in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Engineering.php \PHPExcel_Calculation_Engineering::ERF()

* ERF * * Returns the error function integrated between the lower and upper bound arguments. * * Note: In Excel 2007 or earlier, if you input a negative value for the upper or lower bound arguments, * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was * improved, so that it can now calculate the function for both positive and negative ranges. * PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments. * * Excel Function: * ERF(lower[,upper]) * *

Parameters

float $lower lower bound for integrating ERF: * @param float $upper upper bound for integrating ERF. * If omitted, ERF integrates between zero and lower_limit * @return float

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Engineering.php, line 2268

Class

PHPExcel_Calculation_Engineering
PHPExcel_Calculation_Engineering

Code

public static function ERF($lower, $upper = NULL) {
  $lower = PHPExcel_Calculation_Functions::flattenSingleValue($lower);
  $upper = PHPExcel_Calculation_Functions::flattenSingleValue($upper);
  if (is_numeric($lower)) {
    if (is_null($upper)) {
      return self::_erfVal($lower);
    }
    if (is_numeric($upper)) {
      return self::_erfVal($upper) - self::_erfVal($lower);
    }
  }
  return PHPExcel_Calculation_Functions::VALUE();
}