summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-08-22 06:40:13 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-08-22 06:40:13 +0000
commitc6e3dc4bee0626b04003dec03811d632278b7d9f (patch)
treeea0ce9891fcbf32b4eabe6d5a98cb0738249a05b /tests
parenta6355b8ca02aae1302c48cef6d5dc7135144e581 (diff)
downloadmpfr-c6e3dc4bee0626b04003dec03811d632278b7d9f.tar.gz
[tests/turandom.c] Added a test of the underflow flag.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11639 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/turandom.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/turandom.c b/tests/turandom.c
index dbd21cbbe..b231f6d79 100644
--- a/tests/turandom.c
+++ b/tests/turandom.c
@@ -95,7 +95,13 @@ test_urandom (long nbtests, mpfr_prec_t prec, mpfr_rnd_t rnd, long bit_index,
for (k = 0; k < 5; k++)
{
set_emin (k+1);
+ mpfr_clear_flags ();
inex = mpfr_urandom (x, RANDS, rnd);
+ if (! mpfr_underflow_p ())
+ {
+ printf ("Error: underflow flag not set for emin = %d.\n", k+1);
+ exit (1);
+ }
if (( (rnd == MPFR_RNDZ || rnd == MPFR_RNDD)
&& (!MPFR_IS_ZERO (x) || inex != -1))
|| ((rnd == MPFR_RNDU || rnd == MPFR_RNDA)