You are here

public static function PHPExcel_Calculation_Engineering::IMEXP in Loft Data Grids 6.2

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

* IMEXP * * Returns the exponential of a complex number in x + yi or x + yj text format. * * Excel Function: * IMEXP(complexNumber) * *

Parameters

string $complexNumber The complex number for which you want the exponential.: * @return string

File

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

Class

PHPExcel_Calculation_Engineering
PHPExcel_Calculation_Engineering

Code

public static function IMEXP($complexNumber) {
  $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
  $parsedComplex = self::_parseComplex($complexNumber);
  if ($parsedComplex['real'] == 0.0 && $parsedComplex['imaginary'] == 0.0) {
    return '1';
  }
  $e = exp($parsedComplex['real']);
  $eX = $e * cos($parsedComplex['imaginary']);
  $eY = $e * sin($parsedComplex['imaginary']);
  if ($parsedComplex['suffix'] == '') {
    return self::COMPLEX($eX, $eY);
  }
  else {
    return self::COMPLEX($eX, $eY, $parsedComplex['suffix']);
  }
}