From da280093ff035f98551a4930d9eab20a43c5e3e2 Mon Sep 17 00:00:00 2001 From: enge Date: Mon, 26 Aug 2013 14:40:23 +0000 Subject: 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 --- src/atan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/atan.c b/src/atan.c index 70e1726..b962955 100644 --- a/src/atan.c +++ b/src/atan.c @@ -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 { -- cgit v1.2.1