diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2013-08-26 14:40:23 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2013-08-26 14:40:23 +0000 |
commit | da280093ff035f98551a4930d9eab20a43c5e3e2 (patch) | |
tree | 198d0a20b28bb9358207e352110664ebeba9536d /src | |
parent | 15d1b1ad4772287e0653585492c96a5695251270 (diff) | |
download | mpc-da280093ff035f98551a4930d9eab20a43c5e3e2.tar.gz |
atan, atanh: Fix discrepancy with C standard for (+-0, +-1).
atan.c: Fix special case.
atan.dat: Fix tests.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1301 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src')
-rw-r--r-- | src/atan.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,6 +1,6 @@ /* mpc_atan -- arctangent of a complex number. -Copyright (C) 2009, 2010, 2011, 2012 INRIA +Copyright (C) 2009, 2010, 2011, 2012, 2013 INRIA This file is part of GNU MPC. @@ -133,10 +133,10 @@ mpc_atan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) } else if (cmp_1 == 0) { - /* atan(+/-0+i) = NaN +i*inf - atan(+/-0-i) = NaN -i*inf */ - mpfr_set_nan (mpc_realref (rop)); - mpfr_set_inf (mpc_imagref (rop), s_im ? -1 : +1); + /* atan(+/-0 +i) = +/-0 +i*inf + atan(+/-0 -i) = +/-0 -i*inf */ + mpfr_set_zero (mpc_realref (rop), s_re ? -1 : +1); + mpfr_set_inf (mpc_imagref (rop), s_im ? -1 : +1); } else { |