diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-12-27 16:12:57 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-12-27 16:12:57 +0000 |
commit | 8341305ba4bb5839e101b02a5d4804b16a08ff7f (patch) | |
tree | 0f7cbb8d23e696119b378375fd8cb1b5f3260602 /tests/tsubnormal.c | |
parent | 05e4ca8ce019787085a2cb79c7d5b6d8478d3cf6 (diff) | |
download | mpfr-8341305ba4bb5839e101b02a5d4804b16a08ff7f.tar.gz |
tests: check the exponent range, in particular at the end of each test.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5136 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsubnormal.c')
-rw-r--r-- | tests/tsubnormal.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/tsubnormal.c b/tests/tsubnormal.c index 5e045bfa6..5e63312ea 100644 --- a/tests/tsubnormal.c +++ b/tests/tsubnormal.c @@ -55,6 +55,10 @@ check1 (void) { mpfr_t x; int i, j, k, s, old_inex; + mp_exp_t emin, emax; + + emin = mpfr_get_emin (); + emax = mpfr_get_emax (); mpfr_set_default_prec (9); mpfr_set_emin (-10); @@ -91,6 +95,12 @@ check1 (void) } } mpfr_clear (x); + + MPFR_ASSERTN (mpfr_get_emin () == -10); + MPFR_ASSERTN (mpfr_get_emax () == 10); + + set_emin (emin); + set_emax (emax); } /* bug found by Kevin P. Rauch on 22 Oct 2007 */ @@ -99,6 +109,9 @@ check2 (void) { mpfr_t x, y, z; int tern; + mp_exp_t emin; + + emin = mpfr_get_emin (); mpfr_init2 (x, 32); mpfr_init2 (y, 32); @@ -121,6 +134,10 @@ check2 (void) mpfr_clear (x); mpfr_clear (y); mpfr_clear (z); + + MPFR_ASSERTN (mpfr_get_emin () == -29); + + set_emin (emin); } /* bug found by Kevin P. Rauch on 22 Oct 2007 */ @@ -129,6 +146,9 @@ check3 (void) { mpfr_t x, y, z; int tern; + mp_exp_t emin; + + emin = mpfr_get_emin (); mpfr_init2 (x, 32); mpfr_init2 (y, 32); @@ -170,6 +190,10 @@ check3 (void) mpfr_clear (x); mpfr_clear (y); mpfr_clear (z); + + MPFR_ASSERTN (mpfr_get_emin () == -1); + + set_emin (emin); } int |