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

21 lines
452 B
PHP

--TEST--
bcpow() does not support non-integral exponents
--EXTENSIONS--
bcmath
--FILE--
<?php
try {
var_dump(bcpow('1', '1.1', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
var_dump(bcpow('1', '0.1', 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
bcpow(): Argument #2 ($exponent) cannot have a fractional part
bcpow(): Argument #2 ($exponent) cannot have a fractional part