diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-02-08 15:47:13 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-02-08 15:47:13 +0000 |
commit | 08f8c45d7453a73ba4f4631e89d4a1007d651c5f (patch) | |
tree | 6e4d252ec7e3c8f91e29ea6f89103694f055c815 /mpfr.h | |
parent | 975f12134bafeff2ae15aeb0fc12e83913e1412f (diff) | |
download | mpfr-08f8c45d7453a73ba4f4631e89d4a1007d651c5f.tar.gz |
Reimplemented mpfr_set_si_2exp and mpfr_set_ui_2exp, and mpfr_set_si
and mpfr_set_ui using the 2exp versions with e = 0. This fixes a bug
in corner cases (emin >= 4 and some other constraints) in mpfr_set_si
and mpfr_set_ui that incorrectly lead to an underflow flag set, and
fixes mpfr_set_si_2exp and mpfr_set_ui_2exp in case of overflow or
underflow (replacing the r4346 fix). Added corresponding testcases.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4352 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'mpfr.h')
-rw-r--r-- | mpfr.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -649,13 +649,13 @@ __MPFR_DECLSPEC int mpfr_custom_get_kind _MPFR_PROTO ((mpfr_srcptr)); _p->_mpfr_sign = 1; \ _p->_mpfr_exp = __MPFR_EXP_ZERO; \ (void) (_r); 0; }) : \ - mpfr_set_ui (_f,_u,_r)) + mpfr_set_ui_2exp ((_f), (_u), 0, (_r))) #endif #undef mpfr_set_si #define mpfr_set_si(_f,_s,_r) \ (__builtin_constant_p (_s) && (_s) >= 0 ? \ mpfr_set_ui ((_f), (_s), (_r)) : \ - mpfr_set_si ((_f), (_s), (_r))) + mpfr_set_si_2exp ((_f), (_s), 0, (_r))) #endif #endif |