php-src/ext/bcmath/tests/bcdiv_error1.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

33 lines
557 B
PHP

--TEST--
bcdiv Divide two arbitrary precision numbers
--CREDITS--
TestFest2009
Antoni Torrents
antoni@solucionsinternet.com
--EXTENSIONS--
bcmath
--FILE--
<?php
try {
bcdiv('10.99', '0');
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
try {
bcdiv('10.99', '0.00');
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
try {
bcdiv('10.99', '-0.00');
} catch (DivisionByZeroError $ex) {
echo $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Division by zero
Division by zero
Division by zero