diff options
author | zimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2009-11-20 13:28:30 +0000 |
---|---|---|
committer | zimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2009-11-20 13:28:30 +0000 |
commit | ea0af5971c3e88793a5db1a4582d2059cabd2ec6 (patch) | |
tree | 30df40eb686497bbb6570cd24d4a15df10329407 /tests/tacosh.c | |
parent | 8666c83c0721d66466240a394bf53a52ad5c4cab (diff) | |
download | mpc-ea0af5971c3e88793a5db1a4582d2059cabd2ec6.tar.gz |
fixed bug reported by Geoff Bailey (acosh, asinh and atanh swap the precisions
of their inputs)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@723 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/tacosh.c')
-rw-r--r-- | tests/tacosh.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/tacosh.c b/tests/tacosh.c index 022610d..cc964f5 100644 --- a/tests/tacosh.c +++ b/tests/tacosh.c @@ -1,6 +1,6 @@ /* test file for mpc_acosh. -Copyright (C) 2009 Philippe Th\'eveny +Copyright (C) 2009 Philippe Th\'eveny, Paul Zimmermann This file is part of the MPC Library. @@ -21,6 +21,25 @@ MA 02111-1307, USA. */ #include "mpc-tests.h" +static void +bug20091120 (void) +{ + mpc_t x, y; + + mpc_init2 (x, 53); + mpc_init3 (y, 17, 42); + mpc_set_ui_ui (x, 1, 1, MPC_RNDNN); + mpc_acosh (y, x, MPC_RNDNN); + if (mpfr_get_prec (mpc_realref(y)) != 17 || + mpfr_get_prec (mpc_imagref(y)) != 42) + { + printf ("Error, mpc_acosh changed the precisions!!!\n"); + exit (1); + } + mpc_clear (x); + mpc_clear (y); +} + int main (void) { @@ -28,6 +47,8 @@ main (void) test_start (); + bug20091120 (); + data_check (f, "acosh.dat"); tgeneric (f, 2, 512, 7, 7); |