Commit 77b558e2 by Steven G. Kargl

arith.c (gfc_check_real_range): Use correct exponent range for subnormal numbers.

2006-10-03  Steven G. Kargl  <kargl@gcc.gnu.org>

	* arith.c (gfc_check_real_range):  Use correct exponent range for
	subnormal numbers.

From-SVN: r117414
parent 5be38273
2006-10-03 Steven G. Kargl <kargl@gcc.gnu.org>
* arith.c (gfc_check_real_range): Use correct exponent range for
subnormal numbers.
2006-10-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29284
......
......@@ -438,14 +438,16 @@ gfc_check_real_range (mpfr_t p, int kind)
gfc_free (bin);
#else
mp_exp_t emin, emax;
int en;
/* Save current values of emin and emax. */
emin = mpfr_get_emin ();
emax = mpfr_get_emax ();
/* Set emin and emax for the current model number. */
mpfr_set_emin ((mp_exp_t) gfc_real_kinds[i].min_exponent - 1);
mpfr_set_emax ((mp_exp_t) gfc_real_kinds[i].max_exponent - 1);
en = gfc_real_kinds[i].min_exponent - gfc_real_kinds[i].digits + 1;
mpfr_set_emin ((mp_exp_t) en);
mpfr_set_emax ((mp_exp_t) gfc_real_kinds[i].max_exponent);
mpfr_subnormalize (q, 0, GFC_RND_MODE);
/* Reset emin and emax. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment