You are here

private static function PHPExcel_Reader_Excel5::_extractNumber in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php \PHPExcel_Reader_Excel5::_extractNumber()

* Reads first 8 bytes of a string and return IEEE 754 float * *

Parameters

string $data Binary string that is at least 8 bytes long: * @return float

9 calls to PHPExcel_Reader_Excel5::_extractNumber()
PHPExcel_Reader_Excel5::_getNextToken in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Fetch next token from binary formula data * *
PHPExcel_Reader_Excel5::_readBIFF8Constant in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* read BIFF8 constant value which may be 'Empty Value', 'Number', 'String Value', 'Boolean Value', 'Error Value' * section 2.5.7 * returns e.g. array('value' => '5',…
PHPExcel_Reader_Excel5::_readBottomMargin in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Read BOTTOMMARGIN record
PHPExcel_Reader_Excel5::_readFormula in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Read FORMULA record + perhaps a following STRING record if formula result is a string * This record contains the token array and the result of a * formula cell. * * -- "OpenOffice.org's Documentation of the Microsoft * Excel…
PHPExcel_Reader_Excel5::_readLeftMargin in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php
* Read LEFTMARGIN record

... See full list

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel5.php, line 6670

Class

PHPExcel_Reader_Excel5
PHPExcel_Reader_Excel5

Code

private static function _extractNumber($data) {
  $rknumhigh = self::_GetInt4d($data, 4);
  $rknumlow = self::_GetInt4d($data, 0);
  $sign = ($rknumhigh & 0x80000000) >> 31;
  $exp = (($rknumhigh & 0x7ff00000) >> 20) - 1023;
  $mantissa = 0x100000 | $rknumhigh & 0xfffff;
  $mantissalow1 = ($rknumlow & 0x80000000) >> 31;
  $mantissalow2 = $rknumlow & 0x7fffffff;
  $value = $mantissa / pow(2, 20 - $exp);
  if ($mantissalow1 != 0) {
    $value += 1 / pow(2, 21 - $exp);
  }
  $value += $mantissalow2 / pow(2, 52 - $exp);
  if ($sign) {
    $value *= -1;
  }
  return $value;
}