php-src/ext/bcmath/tests/bcdiv_error1.phpt

33 lines
557 B
Plaintext
Raw Permalink Normal View History

2009-08-30 11:10:20 +00:00
--TEST--
bcdiv — Divide two arbitrary precision numbers
--CREDITS--
TestFest2009
Antoni Torrents
antoni@solucionsinternet.com
--EXTENSIONS--
bcmath
2009-08-30 11:10:20 +00:00
--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;
}
2009-08-30 11:10:20 +00:00
?>
--EXPECT--
Division by zero
Division by zero
Division by zero