diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-09-08 08:35:04 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-09-08 08:35:04 +0000 |
commit | f8794b0b7fdc6b26c8945f156d59263b42a86b29 (patch) | |
tree | fa10c1a516b9b773929e97e6a07fd0721fe1dbfe /tests/tdigamma.c | |
parent | ecb23ca95df59e98128619408588f01c1569180d (diff) | |
download | mpfr-f8794b0b7fdc6b26c8945f156d59263b42a86b29.tar.gz |
[digamma.c] forgot to set sign for Psi(+Inf)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6412 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tdigamma.c')
-rw-r--r-- | tests/tdigamma.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/tdigamma.c b/tests/tdigamma.c index 351aacdf7..0721a9a7d 100644 --- a/tests/tdigamma.c +++ b/tests/tdigamma.c @@ -26,11 +26,37 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define TEST_FUNCTION mpfr_digamma #include "tgeneric.c" +static void +special () +{ + mpfr_t x, y; + + mpfr_init (x); + mpfr_init (y); + + mpfr_set_inf (y, -1); + mpfr_set_inf (x, 1); + mpfr_digamma (y, x, MPFR_RNDN); + if (mpfr_inf_p (y) == 0 || mpfr_sgn (y) < 0) + { + printf ("error for Psi(+Inf)\n"); + printf ("expected +Inf\n"); + printf ("got "); + mpfr_dump (y); + exit (1); + } + + mpfr_clear (x); + mpfr_clear (y); +} + int main (int argc, char *argv[]) { tests_start_mpfr (); + special (); + test_generic (2, 100, 2); data_check ("data/digamma", mpfr_digamma, "mpfr_digamma"); |