diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-09-21 12:42:37 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-09-21 12:42:37 +0000 |
commit | 4beb1c57e8068248bca510a3a418affde4a14b19 (patch) | |
tree | 81ae252ec15a56d940381f18d767f32dbc716fe3 /strtofr.c | |
parent | 4321457550636d508bf623a6ae1704ce7b1bac9a (diff) | |
download | mpfr-4beb1c57e8068248bca510a3a418affde4a14b19.tar.gz |
Fix a bug in FreeBsd 5.20 / Alpha / Gcc 3.3.3.
Not a MPFR bug, but add some code to avoid it.
Reference: http://www.freebsd.org/cgi/query-pr.cgi?pr=72024
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2982 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'strtofr.c')
-rw-r--r-- | strtofr.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -490,9 +490,11 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mp_rnd_t rnd) mp_exp_t, mp_exp_unsigned_t, MPFR_EXP_MIN, MPFR_EXP_MAX, goto overflow, goto underflow); - if (tmp > 0 && MPFR_EXP_MAX/pow2 <= tmp) + /* On some FreeBsd/Alpha, LONG_MIN/1 produces an exception + so we check for this before doing the division */ + if (tmp > 0 && pow2 != 1 && MPFR_EXP_MAX/pow2 <= tmp) goto overflow; - else if (tmp < 0 && MPFR_EXP_MIN/pow2 >= tmp) + else if (tmp < 0 && pow2 != 1 && MPFR_EXP_MIN/pow2 >= tmp) goto underflow; tmp *= pow2; MPFR_SADD_OVERFLOW (tmp, tmp, pstr->exp_bin, |