mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Fix #78238: BCMath returns "-0"
There is no negative zero in the decimal system, so we must suppress the sign. Closes GH-7250.
This commit is contained in:
parent
8f97f82e35
commit
bcb89c75ec
5 changed files with 32 additions and 3 deletions
|
@ -50,7 +50,7 @@ zend_string
|
|||
int index, signch;
|
||||
|
||||
/* Allocate the string memory. */
|
||||
signch = num->n_sign != PLUS; /* Number of sign chars. */
|
||||
signch = num->n_sign != PLUS && !bc_is_zero_for_scale(num, MIN(num->n_scale, scale)); /* Number of sign chars. */
|
||||
if (scale > 0)
|
||||
str = zend_string_alloc(num->n_len + scale + signch + 1, 0);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue