From b02eed9c4841913d690a2d0029737d72615384fe Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 21 Apr 2015 23:04:11 +0000 Subject: complex: fix ctanh(+-0+i*nan) and ctanh(+-0+-i*inf) These cases were incorrect in C11 as described by http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1886.htm --- src/complex/ctanhf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/complex/ctanhf.c') diff --git a/src/complex/ctanhf.c b/src/complex/ctanhf.c index a7e1a5fc..72b76da0 100644 --- a/src/complex/ctanhf.c +++ b/src/complex/ctanhf.c @@ -50,7 +50,7 @@ float complex ctanhf(float complex z) } if (!isfinite(y)) - return CMPLXF(y - y, y - y); + return CMPLXF(ix ? y - y : x, y - y); if (ix >= 0x41300000) { /* x >= 11 */ float exp_mx = expf(-fabsf(x)); -- cgit v1.2.1