diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-05-29 12:48:06 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-05-29 12:48:06 +0000 |
commit | 05a52afd344160605489652b532cd138f8f15801 (patch) | |
tree | 456b514e2174a6b84945ffff84008b0b0a2f80c4 /add_one_ulp.c | |
parent | cd7ec64eeec5dd393d5b4ee5c286f4a6c0920cac (diff) | |
download | mpfr-05a52afd344160605489652b532cd138f8f15801.tar.gz |
Bug fixed (possible integer overflow).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1937 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'add_one_ulp.c')
-rw-r--r-- | add_one_ulp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/add_one_ulp.c b/add_one_ulp.c index 8baadaf8f..367182f88 100644 --- a/add_one_ulp.c +++ b/add_one_ulp.c @@ -1,6 +1,6 @@ /* mpfr_add_one_ulp -- add one unit in last place -Copyright 1999, 2001 Free Software Foundation, Inc. +Copyright 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of the MPFR Library. @@ -39,7 +39,7 @@ mpfr_add_one_ulp (mpfr_ptr x, mp_rnd_t rnd_mode) return 0; xn = 1 + (MPFR_PREC(x) - 1) / BITS_PER_MP_LIMB; - sh = xn * BITS_PER_MP_LIMB - MPFR_PREC(x); + sh = (mp_prec_t) xn * BITS_PER_MP_LIMB - MPFR_PREC(x); xp = MPFR_MANT(x); if (mpn_add_1 (xp, xp, xn, MP_LIMB_T_ONE << sh)) /* got 1.0000... */ { |