Fix for bug #9527 (negative zero is a nonsence)

parent 46cf8b5a
...@@ -1924,6 +1924,17 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) ...@@ -1924,6 +1924,17 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
for (; carry; buf0--) for (; carry; buf0--)
ADD(*buf0, *buf0, 0, carry); ADD(*buf0, *buf0, 0, carry);
} }
/* Now we have to check for -0.000 case */
if (to->sign)
{
dec1 *buf= to->buf;
dec1 *end= to->buf + intg0 + frac0;
for (; (buf<end) && !*buf; buf++);
if (buf == end)
/* So we got decimal zero */
decimal_make_zero(to);
}
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment