summaryrefslogtreecommitdiff
path: root/tests/tmul_2exp.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-24 09:12:03 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-24 09:12:03 +0000
commit53062736c152be21b77b11fec1a29699e6c7a30c (patch)
treeb1f384e00645646e00499ef066720a3eae61e504 /tests/tmul_2exp.c
parenta6c20cdb1b58fb4d3c3bc2d03c0b10f951a8b8b5 (diff)
downloadmpfr-53062736c152be21b77b11fec1a29699e6c7a30c.tar.gz
Improve test coverage.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2797 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tmul_2exp.c')
-rw-r--r--tests/tmul_2exp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/tmul_2exp.c b/tests/tmul_2exp.c
index 511ef540d..645210f72 100644
--- a/tests/tmul_2exp.c
+++ b/tests/tmul_2exp.c
@@ -116,6 +116,19 @@ main (int argc, char *argv[])
}
}
+ if (MPFR_EXP_MAX >= LONG_MAX/2 && MPFR_EXP_MIN <= LONG_MAX/2-LONG_MAX-1)
+ {
+ mpfr_set_ui (w, 1, GMP_RNDN);
+ mpfr_mul_2ui (w, w, LONG_MAX/2, GMP_RNDZ);
+ mpfr_div_2ui (w, w, LONG_MAX+1, GMP_RNDZ);
+ mpfr_mul_2ui (w, w, LONG_MAX+1-LONG_MAX/2, GMP_RNDZ);
+ if (!mpfr_cmp_ui (w, 1))
+ {
+ printf ("Underflow LONG_MAX error!\n");
+ exit (1);
+ }
+ }
+
mpfr_clears (w, z, NULL);
tests_end_mpfr ();