summaryrefslogtreecommitdiff
path: root/Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c')
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c b/Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c
index fbfd3136126..b94979b0daa 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c
@@ -1,6 +1,6 @@
/* mpfr_cmp_d -- compare a floating-point number with a long double
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -33,16 +33,14 @@ mpfr_cmp_ld (mpfr_srcptr b, long double d)
MPFR_SAVE_EXPO_MARK (expo);
+#if !HAVE_LDOUBLE_MAYBE_DOUBLE_DOUBLE
mpfr_init2 (tmp, MPFR_LDBL_MANT_DIG);
+#else
+ /* since the smallest value is 2^(-1074) and the largest is < 2^1024,
+ every double-double is exactly representable with 1024 + 1074 bits */
+ mpfr_init2 (tmp, 1024 + 1074);
+#endif
res = mpfr_set_ld (tmp, d, MPFR_RNDN);
- if (res != 0) /* can happen when "long double" is double-double */
- {
- /* since the smallest value is 2^(-1074) and the largest is
- < 2^1024, every double-double is exactly representable with
- 1024 + 1074 bits */
- mpfr_set_prec (tmp, 1024 + 1074);
- res = mpfr_set_ld (tmp, d, MPFR_RNDN);
- }
MPFR_ASSERTD (res == 0);
MPFR_CLEAR_FLAGS ();