mirror of
https://github.com/php/php-src.git
synced 2026-03-26 17:22:15 +01:00
Actually, there is no negative zero at all. We obey Postel's law, and still accept negative zeroes, but we store them as positive zeroes after the conversion from string, i.e. we normalize before further processing.
17 lines
305 B
PHP
17 lines
305 B
PHP
--TEST--
|
|
Bug #46781 (BC math handles minus zero incorrectly)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
var_dump(bcadd('-0.0', '-0.0', 1));
|
|
var_dump(bccomp('-0.0', '0', 1));
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
string(3) "0.0"
|
|
int(0)
|
|
===DONE===
|