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

25 lines
402 B
PHP

--TEST--
bccomp() with negative value
--EXTENSIONS--
bcmath
--INI--
bcmath.scale=0
--FILE--
<?php
echo bccomp("-2", "-2") . "\n";
echo bccomp("-2", "2", "1") . "\n";
echo bccomp("-2.29", "-2.3", "2") . "\n";
echo bccomp("-2.29", "2.3", "2") . "\n";
echo bccomp("2.29", "-2.3", "2") . "\n";
echo bccomp("-2.29", "-2.3", "1") . "\n";
echo bccomp("-2.29", "0", "1") . "\n";
?>
--EXPECT--
0
-1
1
-1
1
1
-1