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/tatanh.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/tatanh.c')
-rw-r--r-- | tests/tatanh.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/tatanh.c b/tests/tatanh.c index 5abd594..4fcb47f 100644 --- a/tests/tatanh.c +++ b/tests/tatanh.c @@ -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_atanh (y, x, MPC_RNDNN); + if (mpfr_get_prec (mpc_realref(y)) != 17 || + mpfr_get_prec (mpc_imagref(y)) != 42) + { + printf ("Error, mpc_atanh 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, "atanh.dat"); tgeneric (f, 2, 512, 5, 128); |