diff --git a/Classes/PHPExcel/Calculation/MathTrig.php b/Classes/PHPExcel/Calculation/MathTrig.php index 9f0e7f4..f3ae111 100644 --- a/Classes/PHPExcel/Calculation/MathTrig.php +++ b/Classes/PHPExcel/Calculation/MathTrig.php @@ -145,8 +145,8 @@ class PHPExcel_Calculation_MathTrig { $significance = $number/abs($number); } - if ((is_numeric($number)) && (is_numeric($significance))) { - if ($significance == 0.0) { + if ((is_numeric($number)) && (is_numeric($significance))) { + if (($number == 0.0 ) || ($significance == 0.0)) { return 0.0; } elseif (self::SIGN($number) == self::SIGN($significance)) { return ceil($number / $significance) * $significance; @@ -316,10 +316,9 @@ class PHPExcel_Calculation_MathTrig { } if ((is_numeric($number)) && (is_numeric($significance))) { - if ((float) $significance == 0.0) { - return PHPExcel_Calculation_Functions::DIV0(); - } - if (self::SIGN($number) == self::SIGN($significance)) { + if (($number == 0.0 ) || ($significance == 0.0)) { + return 0.0; + } elseif (self::SIGN($number) == self::SIGN($significance)) { return floor($number / $significance) * $significance; } else { return PHPExcel_Calculation_Functions::NaN(); diff --git a/changelog.txt b/changelog.txt index 6a5bb81..0b8845f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -37,6 +37,7 @@ Planned for v1.8.1 - Bugfix: (frozenstupidity) Work Item GH-423 - Fix invalid NA return in VLOOKUP - Bugfix: (wiseloren) Work Item CP21454 - "No Impact" conditional formatting fix for NumberFormat - Bugfix: (bobwitlox) Work Item GH-467 - Bug in Excel2003XML reader, parsing merged cells +- Bugfix: (MBaker) Work Item GH-302 - Fix for CEIL() and FLOOR() when number argument is zero - General: (MBaker) - Small performance improvement for autosize columns - General: (frost-nzcr4) Work Item GH-379 - Change the getter/setter for zeroHeight to camel case - General: (MBaker) Work Item GH-394 - DefaultValueBinder is too much aggressive when converting string to numeric