X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fcomplex%2Fctanh.c;h=3ba3a8997d80349099e4b9b98fcac27fae1f828d;hb=b02eed9c4841913d690a2d0029737d72615384fe;hp=0461050d73301adfad8e5571316d96b07556449a;hpb=e98a54643ee95032baab883673628314e520012e;p=oweals%2Fmusl.git diff --git a/src/complex/ctanh.c b/src/complex/ctanh.c index 0461050d..3ba3a899 100644 --- a/src/complex/ctanh.c +++ b/src/complex/ctanh.c @@ -101,11 +101,13 @@ double complex ctanh(double complex z) } /* + * ctanh(+-0 + i NAN) = +-0 + i NaN + * ctanh(+-0 +- i Inf) = +-0 + i NaN * ctanh(x + i NAN) = NaN + i NaN * ctanh(x +- i Inf) = NaN + i NaN */ if (!isfinite(y)) - return CMPLX(y - y, y - y); + return CMPLX(x ? y - y : x, y - y); /* * ctanh(+-huge + i +-y) ~= +-1 +- i 2sin(2y)/exp(2x), using the