diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index 1d104c18..9c6b60ec 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -673,8 +673,8 @@ class MathTrig */ public static function MOD($a = 1, $b = 1) { - $a = Functions::flattenSingleValue($a); - $b = Functions::flattenSingleValue($b); + $a = (float) Functions::flattenSingleValue($a); + $b = (float) Functions::flattenSingleValue($b); if ($b == 0.0) { return Functions::DIV0(); diff --git a/tests/data/Calculation/MathTrig/MOD.php b/tests/data/Calculation/MathTrig/MOD.php index e98e41a7..3aded00a 100644 --- a/tests/data/Calculation/MathTrig/MOD.php +++ b/tests/data/Calculation/MathTrig/MOD.php @@ -46,4 +46,9 @@ return [ 1.3, 1.2, ], + [ + '', + 1, + 0, + ], ];