mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-29 00:36:02 +03:00
Bugfix: Work Item GH-302 - Fix for CEIL() and FLOOR() when number argument is zero
This commit is contained in:
parent
741500da14
commit
4d67ff7de9
@ -146,7 +146,7 @@ class PHPExcel_Calculation_MathTrig {
|
||||
}
|
||||
|
||||
if ((is_numeric($number)) && (is_numeric($significance))) {
|
||||
if ($significance == 0.0) {
|
||||
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();
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user