summaryrefslogtreecommitdiff
path: root/sub.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-05-26 16:20:49 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-05-26 16:20:49 +0000
commit6e2638de014ba01440353f77996ae0a10d5c8e8a (patch)
tree0597864b4d038dad3a811f122fc701d3ca6ed99e /sub.c
parentb82a1ef2757619e4d20f4ff5f3fd6ace150e6f79 (diff)
downloadmpfr-6e2638de014ba01440353f77996ae0a10d5c8e8a.tar.gz
more changes
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@584 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub.c')
-rw-r--r--sub.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sub.c b/sub.c
index 043a7acb6..7f07e27d1 100644
--- a/sub.c
+++ b/sub.c
@@ -331,13 +331,13 @@ mpfr_sub1(a, b, c, rnd_mode, diff_exp)
kc--;
cc -= mpn_sub_1(&c2, bp+(--k), 1, (cp[kc]>>dif) +
(cp[kc+1]<<(mp_bits_per_limb-dif)));
- if (cc==0 || cc==-1) cc=c2;
+ if (cc==0 || (~cc==0 && ~c2==0)) cc=c2;
}
- if ((cc==0 || cc==-1) && kc==0) {
+ if ((cc==0 || (~cc==0)) && kc==0) {
/* it still remains cp[0]<<(mp_bits_per_limb-dif) */
if (k!=0) cc -= mpn_sub_1(&c2, bp+(--k), 1,
cp[0]<<(mp_bits_per_limb-dif));
- else cc -= cp[0]<<(mp_bits_per_limb-dif);
+ else if (cp[0]<<(mp_bits_per_limb-dif)) cc--;
}
if ((long)cc>0) goto add_one_ulp;
else if ((long)cc<-1) goto end_of_sub; /* carry can be at most 1 */