summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-06-26 10:53:46 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-06-26 10:53:46 +0000
commitc2f9131d435bb0f84a018f09f97e51693e4189b1 (patch)
tree274fe56fc09e18e5e770ad863e65416bc657239f /src
parentb19a82e0c918e8786702ceaad07760bd9436479b (diff)
downloadmpfr-c2f9131d435bb0f84a018f09f97e51693e4189b1.tar.gz
[src/vasprintf.c] Fixed assertion failures for tiny numbers (the code
was correct, but the assertions didn't check against the right bound). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9108 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src')
-rw-r--r--src/vasprintf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vasprintf.c b/src/vasprintf.c
index 74c88d97b..2d493ef0d 100644
--- a/src/vasprintf.c
+++ b/src/vasprintf.c
@@ -873,14 +873,18 @@ regular_ab (struct number_parts *np, mpfr_srcptr p,
first digit, we want the exponent for radix two and the decimal
point AFTER the first digit. */
{
- MPFR_ASSERTN (exp > MPFR_EMIN_MIN /4); /* possible overflow */
+ /* An overflow is normally not possible since MPFR_EXP_MIN
+ is twice as large as MPFR_EMIN_MIN. */
+ MPFR_ASSERTN (exp > (MPFR_EXP_MIN + 3) / 4);
exp = (exp - 1) * 4;
}
else
/* EXP is the exponent for decimal point BEFORE the first digit, we
want the exponent for decimal point AFTER the first digit. */
{
- MPFR_ASSERTN (exp > MPFR_EMIN_MIN); /* possible overflow */
+ /* An overflow is normally not possible since MPFR_EXP_MIN
+ is twice as large as MPFR_EMIN_MIN. */
+ MPFR_ASSERTN (exp > MPFR_EXP_MIN);
--exp;
}
}