php-src/ext/bcmath/tests/bcmod_error2.phpt
Jorg Adam Sowa ee22612856
Extend tests of bcmath extension (#11563)
Add coverage for:

 * different formats of zero (0, 0.0)
 * small integers and decimals
 * large integers and large decimals with large fractional part
 * negative numbers for all of the above ones
2023-07-05 17:43:30 +01:00

29 lines
463 B
PHP

--TEST--
bcmod() - mod by 0
--EXTENSIONS--
bcmath
--INI--
bcmath.scale=0
--FILE--
<?php
try {
bcmod("10", "0");
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
try {
bcmod("10", "0.000");
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
try {
bcmod("10", "-0.0");
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Modulo by zero
Modulo by zero
Modulo by zero