diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-02-25 16:07:17 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-02-25 16:07:17 +0000 |
commit | 4c006e283473a721a925d171fc7eaaf36a0dfb4e (patch) | |
tree | 64055fdc93d8284bc960861bdcf79b0f38c0ce6a /tests/tgamma.c | |
parent | c0d5d2f811cdec679408f27f2f9edf1dc8660f99 (diff) | |
download | mpfr-4c006e283473a721a925d171fc7eaaf36a0dfb4e.tar.gz |
[tests/tgamma.c] Added a test in maximum exponent range.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7495 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tgamma.c')
-rw-r--r-- | tests/tgamma.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/tgamma.c b/tests/tgamma.c index 474619033..d4d03702c 100644 --- a/tests/tgamma.c +++ b/tests/tgamma.c @@ -572,6 +572,31 @@ exprange (void) exit (1); } + MPFR_ASSERTN (MPFR_EMIN_MIN == - MPFR_EMAX_MAX); + mpfr_set_emin (MPFR_EMIN_MIN); + mpfr_set_emax (MPFR_EMAX_MAX); + mpfr_set_ui (x, 0, MPFR_RNDN); + mpfr_nextabove (x); + mpfr_set_inf (y, 1); + mpfr_nextbelow (y); + inex1 = -1; + flags1 = MPFR_FLAGS_INEXACT; + mpfr_clear_flags (); + inex2 = mpfr_gamma (z, x, MPFR_RNDD); + flags2 = __gmpfr_flags; + MPFR_ASSERTN (mpfr_inexflag_p ()); + if (inex1 != inex2 || flags1 != flags2 || ! mpfr_equal_p (y, z)) + { + printf ("Error in exprange (test4)\n"); + printf ("Expected inex1 = %d, flags1 = %u, ", SIGN (inex1), flags1); + mpfr_dump (y); + printf ("Got inex2 = %d, flags2 = %u, ", SIGN (inex2), flags2); + mpfr_dump (z); + exit (1); + } + mpfr_set_emin (emin); + mpfr_set_emax (emax); + mpfr_clears (x, y, z, (mpfr_ptr) 0); } |