summaryrefslogtreecommitdiff
path: root/sub.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-09-28 14:03:44 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-09-28 14:03:44 +0000
commit865e085768a0d4c334475c2e76c305f0df1e381b (patch)
tree1e57ce4cc95e54880bcfdeb12361a53314bd777b /sub.c
parent8920da8ae439757d7974a94b7ff9ff9efdea34c2 (diff)
downloadmpfr-865e085768a0d4c334475c2e76c305f0df1e381b.tar.gz
fixed another ABW bug
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@760 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub.c')
-rw-r--r--sub.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sub.c b/sub.c
index 654b35cfe..16c4ffdcc 100644
--- a/sub.c
+++ b/sub.c
@@ -264,7 +264,9 @@ mpfr_sub1(a, b, c, rnd_mode, diff_exp)
printf("overlap=%d\n",overlap);
#endif
if (overlap>=0) {
- cn -= overlap/BITS_PER_MP_LIMB;
+ if (overlap/BITS_PER_MP_LIMB <= cn)
+ cn -= overlap/BITS_PER_MP_LIMB;
+ else cn=0;
overlap %= BITS_PER_MP_LIMB;
/* warning: a shift of zero with mpn_lshift is not allowed */
if (overlap) {