diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-09-30 10:12:24 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-09-30 10:12:24 +0000 |
commit | da84addc6d59b8e1031ee0f71b954f1713d9ff8b (patch) | |
tree | e2da146283879ea88e489e73624cd9643ed31932 /get_z_exp.c | |
parent | 3461d2ed2a7c4eca7b1151e1c8602646ba47136f (diff) | |
download | mpfr-da84addc6d59b8e1031ee0f71b954f1713d9ff8b.tar.gz |
Re-added the assert on the exponent, but replacing MPFR_EMIN_MIN by
MP_EXP_T_MIN (this makes more sense): an assertion failed would mean
that the exponent is not representable (an undefined behavior in the
ISO C standard). If need be, we could choose to return MP_EXP_T_MIN
in such a case, or perhaps MP_EXP_T_MAX to signal an error. The
mantissa would still be meaningful.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2459 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'get_z_exp.c')
-rw-r--r-- | get_z_exp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/get_z_exp.c b/get_z_exp.c index 5eaa3c62f..763c5a9b0 100644 --- a/get_z_exp.c +++ b/get_z_exp.c @@ -65,10 +65,11 @@ mpfr_get_z_exp (mpz_ptr z, mpfr_srcptr f) SIZ(z) = MPFR_SIGN(f) < 0 ? -fn : fn; - /* This always fails for very small "f", ie. when MPFR_EXP(f) is equal to - or only just above MPFR_EMIN_MIN. - MPFR_ASSERTN((mp_exp_unsigned_t) MPFR_GET_EXP (f) - MPFR_EMIN_MIN + /* Test if the result is representable. Later, we could choose + to return MP_EXP_T_MIN if it isn't, or perhaps MP_EXP_T_MAX + to signal an error. The mantissa would still be meaningful. */ + MPFR_ASSERTN((mp_exp_unsigned_t) MPFR_GET_EXP (f) - MP_EXP_T_MIN >= (mp_exp_unsigned_t) MPFR_PREC(f)); - */ + return MPFR_GET_EXP (f) - MPFR_PREC (f); } |