1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-20 13:13:59 +03:00

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

strings/decimal.c:
  added the check to make sure we don't ge -0.00
This commit is contained in:
unknown 2005-05-07 14:41:00 +05:00
parent 0228f89725
commit 77cb61d2cf

View File

@ -1924,6 +1924,17 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
for (; carry; buf0--)
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;
}