diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-09-17 07:59:22 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-09-17 07:59:22 +0000 |
commit | d1e351d7bc888bfca9a23b59451fdab732b70537 (patch) | |
tree | afea390614b14d630a2d79c885beddca5f8430a6 /Build/source/texk/web2c/mplibdir/mpmathbinary.w | |
parent | 3dedf61fab26192ee1ea3dc584e863ea617ced3d (diff) |
mplibdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@42088 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/mplibdir/mpmathbinary.w')
-rw-r--r-- | Build/source/texk/web2c/mplibdir/mpmathbinary.w | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/mplibdir/mpmathbinary.w b/Build/source/texk/web2c/mplibdir/mpmathbinary.w index f0d134a58e1..287243c6d26 100644 --- a/Build/source/texk/web2c/mplibdir/mpmathbinary.w +++ b/Build/source/texk/web2c/mplibdir/mpmathbinary.w @@ -1100,6 +1100,24 @@ void mp_ab_vs_cd (MP mp, mp_number *ret, mp_number a_orig, mp_number b_orig, mp_ mpfr_set(b, (mpfr_ptr )b_orig.data.num, ROUNDING); mpfr_set(c, (mpfr_ptr )c_orig.data.num, ROUNDING); mpfr_set(d, (mpfr_ptr )d_orig.data.num, ROUNDING); + + mpfr_mul(q,a,b,ROUNDING); + mpfr_mul(r,c,d,ROUNDING); + cmp = mpfr_cmp(q,r); + if (cmp==0) { + mpfr_set(ret->data.num, zero, ROUNDING); + goto RETURN; + } + if (cmp>0) { + mpfr_set(ret->data.num, one, ROUNDING); + goto RETURN; + } + if (cmp<0) { + mpfr_set(ret->data.num, minusone, ROUNDING); + goto RETURN; + } + + /*TODO: remove this part of the code until RETURN */ @<Reduce to the case that |a,c>=0|, |b,d>0|@>; while (1) { mpfr_div(q,a,d, ROUNDING); |