1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 11:32:11 +02:00
Files
archived-php-src/ext/bcmath/tests/bug78238.phpt
Christoph M. Becker bcb89c75ec Fix #78238: BCMath returns "-0"
There is no negative zero in the decimal system, so we must suppress
the sign.

Closes GH-7250.
2021-07-16 15:54:24 +02:00

19 lines
324 B
PHP

--TEST--
Bug #78238 (BCMath returns "-0")
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die("sikp bcmath extension not available");
?>
--FILE--
<?php
var_dump(bcadd("0", "-0.1"));
$a = bcmul("0.9", "-0.1", 1);
$b = bcmul("0.90", "-0.1", 1);
var_dump($a, $b);
?>
--EXPECT--
string(1) "0"
string(3) "0.0"
string(3) "0.0"