2009-08-30 11:10:20 +00:00
|
|
|
--TEST--
|
|
|
|
bcdiv — Divide two arbitrary precision numbers
|
|
|
|
--CREDITS--
|
|
|
|
TestFest2009
|
|
|
|
Antoni Torrents
|
|
|
|
antoni@solucionsinternet.com
|
2021-03-22 13:10:15 +00:00
|
|
|
--EXTENSIONS--
|
|
|
|
bcmath
|
2009-08-30 11:10:20 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2019-10-28 10:59:20 +00:00
|
|
|
try {
|
|
|
|
bcdiv('10.99', '0');
|
|
|
|
} catch (DivisionByZeroError $ex) {
|
|
|
|
echo $ex->getMessage(), PHP_EOL;
|
|
|
|
}
|
2023-07-05 16:43:30 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2009-08-30 11:10:20 +00:00
|
|
|
?>
|
2019-10-28 10:59:20 +00:00
|
|
|
--EXPECT--
|
|
|
|
Division by zero
|
2023-07-05 16:43:30 +00:00
|
|
|
Division by zero
|
|
|
|
Division by zero
|