You are here

public static function PHPExcel_Calculation_Engineering::IMLN 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::IMLN()

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

Parameters

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

2 calls to PHPExcel_Calculation_Engineering::IMLN()
PHPExcel_Calculation_Engineering::IMLOG10 in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Engineering.php
* IMLOG10 * * Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format. * * Excel Function: * IMLOG10(complexNumber) * *
PHPExcel_Calculation_Engineering::IMLOG2 in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Engineering.php
* IMLOG2 * * Returns the base-2 logarithm of a complex number in x + yi or x + yj text format. * * Excel Function: * IMLOG2(complexNumber) * *

File

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

Class

PHPExcel_Calculation_Engineering
PHPExcel_Calculation_Engineering

Code

public static function IMLN($complexNumber) {
  $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
  $parsedComplex = self::_parseComplex($complexNumber);
  if ($parsedComplex['real'] == 0.0 && $parsedComplex['imaginary'] == 0.0) {
    return PHPExcel_Calculation_Functions::NaN();
  }
  $logR = log(sqrt($parsedComplex['real'] * $parsedComplex['real'] + $parsedComplex['imaginary'] * $parsedComplex['imaginary']));
  $t = self::IMARGUMENT($complexNumber);
  if ($parsedComplex['suffix'] == '') {
    return self::COMPLEX($logR, $t);
  }
  else {
    return self::COMPLEX($logR, $t, $parsedComplex['suffix']);
  }
}