summaryrefslogtreecommitdiff
path: root/sub1.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-03-26 13:27:16 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-03-26 13:27:16 +0000
commit9f1f8d25b276fcfc67c6e231f9239b2e49646099 (patch)
tree743d3437a1426c0090f01ae1137e3261f42639a4 /sub1.c
parent59944129ef3733a50e0628588027047c03646d8f (diff)
downloadmpfr-9f1f8d25b276fcfc67c6e231f9239b2e49646099.tar.gz
Change from MP_LIMB_T_ONE to MPFR_LIMB_ONE and/or MPFR_LIMB_MASK.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2858 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub1.c')
-rw-r--r--sub1.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sub1.c b/sub1.c
index 5ebdc65f5..6bdbebcc3 100644
--- a/sub1.c
+++ b/sub1.c
@@ -234,7 +234,7 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
/* now perform rounding */
sh = (mp_prec_t) an * BITS_PER_MP_LIMB - MPFR_PREC(a);
/* last unused bits from a */
- carry = ap[0] & ((MP_LIMB_T_ONE << sh) - MP_LIMB_T_ONE);
+ carry = ap[0] & MPFR_LIMB_MASK (sh);
ap[0] -= carry;
if (MPFR_LIKELY(rnd_mode == GMP_RNDN))
@@ -244,8 +244,8 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
is_exact = (carry == 0);
/* can decide except when carry = 2^(sh-1) [middle]
or carry = 0 [truncate, but cannot decide inexact flag] */
- down = (carry < (MP_LIMB_T_ONE << (sh - 1)));
- if (carry > (MP_LIMB_T_ONE << (sh - 1)))
+ down = (carry < (MPFR_LIMB_ONE << (sh - 1)));
+ if (carry > (MPFR_LIMB_ONE << (sh - 1)))
goto add_one_ulp;
else if ((0 < carry) && down)
{
@@ -402,12 +402,12 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
goto truncate;
sub_one_ulp: /* sub one unit in last place to a */
- mpn_sub_1 (ap, ap, an, MP_LIMB_T_ONE << sh);
+ mpn_sub_1 (ap, ap, an, MPFR_LIMB_ONE << sh);
inexact = -1;
goto end_of_sub;
add_one_ulp: /* add one unit in last place to a */
- if (MPFR_UNLIKELY(mpn_add_1 (ap, ap, an, MP_LIMB_T_ONE << sh)))
+ if (MPFR_UNLIKELY(mpn_add_1 (ap, ap, an, MPFR_LIMB_ONE << sh)))
/* result is a power of 2: 11111111111111 + 1 = 1000000000000000 */
{
ap[an-1] = MPFR_LIMB_HIGHBIT;