summaryrefslogtreecommitdiff
path: root/src/get_ld.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-12-25 17:08:16 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-12-25 17:08:16 +0000
commitf60663d1aebfa7cf843944f4c33223757c495229 (patch)
treee4dd6c38a0b0738af11d430a3c6576f39da24539 /src/get_ld.c
parent46398f7d724b098d3f5fcff2adab8ae97a928112 (diff)
downloadmpfr-f60663d1aebfa7cf843944f4c33223757c495229.tar.gz
[src/get_ld.c] Minor performance improvement.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7311 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/get_ld.c')
-rw-r--r--src/get_ld.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/get_ld.c b/src/get_ld.c
index b6c05d28c..e02a28266 100644
--- a/src/get_ld.c
+++ b/src/get_ld.c
@@ -46,7 +46,12 @@ mpfr_get_ld (mpfr_srcptr x, mpfr_rnd_t rnd_mode)
all subsequent operations are exact (this avoids double rounding
problems) */
mpfr_init2 (y, MPFR_LDBL_MANT_DIG);
- mpfr_init2 (z, IEEE_DBL_MANT_DIG);
+ mpfr_init2 (z, MPFR_LDBL_MANT_DIG);
+ /* Note about the precision of z: even though IEEE_DBL_MANT_DIG is
+ sufficient, z has been set to the same precision as y so that
+ the mpfr_sub below calls mpfr_sub1sp, which is faster than the
+ generic subtraction, even in this particular case (from tests
+ done by Patrick Pelissier on a 64-bit Core2 Duo against r7285). */
mpfr_set (y, x, rnd_mode);
sh = MPFR_GET_EXP (y);