mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57: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
33 lines
557 B
PHP
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
|