xref: /PHP-8.3/ext/bcmath/tests/bcpow_error1.phpt (revision ee226128)
1--TEST--
2bcpow() does not support non-integral exponents
3--EXTENSIONS--
4bcmath
5--FILE--
6<?php
7try {
8    var_dump(bcpow('1', '1.1', 2));
9} catch (\ValueError $e) {
10    echo $e->getMessage() . \PHP_EOL;
11}
12try {
13    var_dump(bcpow('1', '0.1', 2));
14} catch (\ValueError $e) {
15    echo $e->getMessage() . \PHP_EOL;
16}
17?>
18--EXPECT--
19bcpow(): Argument #2 ($exponent) cannot have a fractional part
20bcpow(): Argument #2 ($exponent) cannot have a fractional part
21