mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
ee22612856
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
29 lines
463 B
PHP
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
|