mirror of
https://github.com/php/php-src.git
synced 2026-04-14 11:32:11 +02:00
There is no negative zero in the decimal system, so we must suppress the sign. Closes GH-7250.
19 lines
324 B
PHP
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"
|