summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2018-09-03 14:05:11 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2018-09-03 14:05:11 +0000
commit7e489350a89fa779d4817b92da9c70c399b81c26 (patch)
treeb2235e85f1f31e61b2dcb5c37f9e6e4118275fbc /src
parent80f6183d7704ef21c6534b5621109ae6b6b0cd68 (diff)
downloadmpfr-7e489350a89fa779d4817b92da9c70c399b81c26.tar.gz
[src/cmp_si.c] adapt for reduced exponent range for 16-bit limbs
[src/cmp_ui.c] likewise git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13110 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src')
-rw-r--r--src/cmp_si.c4
-rw-r--r--src/cmp_ui.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/cmp_si.c b/src/cmp_si.c
index fe3dda381..6eb18bd4d 100644
--- a/src/cmp_si.c
+++ b/src/cmp_si.c
@@ -96,9 +96,13 @@ mpfr_cmp_si_2exp (mpfr_srcptr b, long int i, mpfr_exp_t f)
{
mpfr_t uu;
int ret;
+ MPFR_SAVE_EXPO_DECL (expo);
mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ /* Warning: i*2^f might be outside the current exponent range! */
+ MPFR_SAVE_EXPO_MARK (expo);
mpfr_set_si_2exp (uu, i, f, MPFR_RNDZ);
+ MPFR_SAVE_EXPO_FREE (expo);
ret = mpfr_cmp (b, uu);
mpfr_clear (uu);
return ret;
diff --git a/src/cmp_ui.c b/src/cmp_ui.c
index 5942c46cc..976f23e1d 100644
--- a/src/cmp_ui.c
+++ b/src/cmp_ui.c
@@ -96,9 +96,13 @@ mpfr_cmp_ui_2exp (mpfr_srcptr b, unsigned long int i, mpfr_exp_t f)
{
mpfr_t uu;
int ret;
+ MPFR_SAVE_EXPO_DECL (expo);
mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ /* Warning: i*2^f might be outside the current exponent range! */
+ MPFR_SAVE_EXPO_MARK (expo);
mpfr_set_ui_2exp (uu, i, f, MPFR_RNDZ);
+ MPFR_SAVE_EXPO_FREE (expo);
ret = mpfr_cmp (b, uu);
mpfr_clear (uu);
return ret;