summaryrefslogtreecommitdiff
path: root/mpf
diff options
context:
space:
mode:
authorTorbjorn Granlund <tg@gmplib.org>2017-03-12 14:49:01 +0100
committerTorbjorn Granlund <tg@gmplib.org>2017-03-12 14:49:01 +0100
commit9699b4c085f6eb71d851c85f8f12895edcd94a90 (patch)
treed6cf301a0e57a7f9a9adb4980ceccbf1f9e09d98 /mpf
parentb22045ee5dd9edbbce76f7ee66f5f5739459cdc0 (diff)
downloadgmp-9699b4c085f6eb71d851c85f8f12895edcd94a90.tar.gz
Amend last change: Let mpn_get_d handle sign.
Diffstat (limited to 'mpf')
-rw-r--r--mpf/get_d_2exp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mpf/get_d_2exp.c b/mpf/get_d_2exp.c
index 61a069e60..440a75301 100644
--- a/mpf/get_d_2exp.c
+++ b/mpf/get_d_2exp.c
@@ -38,7 +38,6 @@ mpf_get_d_2exp (signed long int *expptr, mpf_srcptr src)
mp_size_t size, abs_size;
mp_srcptr ptr;
int cnt;
- double d;
size = SIZ(src);
if (UNLIKELY (size == 0))
@@ -53,7 +52,5 @@ mpf_get_d_2exp (signed long int *expptr, mpf_srcptr src)
cnt -= GMP_NAIL_BITS;
*expptr = EXP(src) * GMP_NUMB_BITS - cnt;
-
- d = mpn_get_d (ptr, abs_size, 0, -(abs_size * GMP_NUMB_BITS - cnt));
- return size >= 0 ? d : -d;
+ return mpn_get_d (ptr, abs_size, size, -(abs_size * GMP_NUMB_BITS - cnt));
}