summaryrefslogtreecommitdiff
path: root/div.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-02-01 16:31:05 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-02-01 16:31:05 +0000
commit9bc0af6a442cb513b4b3be27590b67cdb78b4da7 (patch)
tree50325c12f1df9d29df856b37fa5071b653c05f8c /div.c
parentdf4e266a905927c6117ad87a5b73e52125bb7e0b (diff)
downloadmpfr-9bc0af6a442cb513b4b3be27590b67cdb78b4da7.tar.gz
use mpn_divrem_n (Burnikel-Ziegler algorithm) instead of mpn_divrem
when rsize=rrsize git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@430 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'div.c')
-rw-r--r--div.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/div.c b/div.c
index 676d35c13..ee1475694 100644
--- a/div.c
+++ b/div.c
@@ -137,7 +137,9 @@ mpfr_div (mpfr_ptr r, mpfr_srcptr u, mpfr_srcptr v, unsigned char rnd_mode)
printf(".\n");
#endif
- q_limb = mpn_divrem (rp, 0, tp0, rsize+rrsize, tmp, rsize);
+ q_limb = (rsize==rrsize) /* use Burnikel-Ziegler algorithm */
+ ? mpn_divrem_n (rp, tp0, tmp, rsize)
+ : mpn_divrem (rp, 0, tp0, rsize+rrsize, tmp, rsize);
tp = tp0; /* location of remainder */
#ifdef DEBUG
@@ -164,7 +166,7 @@ mpfr_div (mpfr_ptr r, mpfr_srcptr u, mpfr_srcptr v, unsigned char rnd_mode)
if (k) { mpn_lshift(rp, rp, rrsize, k); }
rexp -= k;
}
-
+
can_round = (mpfr_can_round_raw(rp, rrsize, sign_quotient, err,
GMP_RNDN, rnd_mode, PREC(r))
|| (usize == rsize && vsize == rsize &&