diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index 823f6ef2..b8449b55 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -851,7 +851,7 @@ class MathTrig $multiple = Functions::flattenSingleValue($multiple); if ((is_numeric($number)) && (is_numeric($multiple))) { - if ($multiple == 0) { + if ($number == 0 || $multiple == 0) { return 0; } if ((self::SIGN($number)) == (self::SIGN($multiple))) { diff --git a/tests/data/Calculation/MathTrig/MROUND.php b/tests/data/Calculation/MathTrig/MROUND.php index 38017b65..71655485 100644 --- a/tests/data/Calculation/MathTrig/MROUND.php +++ b/tests/data/Calculation/MathTrig/MROUND.php @@ -41,6 +41,11 @@ return [ 31415.92654, 1, ], + [ + 0, + 0, + 5, + ], [ '#NUM!', 5,