From d15e83c5f5231d971472b5ffc9219d54056ca0f1 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 7 Dec 2017 16:21:00 +0000 Subject: Fix ctanh (0 + i NaN), ctanh (0 + i Inf) (bug 22568, DR#471). As per C11 DR#471, ctanh (0 + i NaN) and ctanh (0 + i Inf) should return 0 + i NaN (with "invalid" exception in the second case but not the first), not NaN + i NaN. This has corresponding implications for ctan since its special cases are defined by ctan (z) = -i ctanh (iz). This patch implements these cases for ctanh and ctan, updating tests accordingly. Tested for x86_64. [BZ #22568] * math/s_ctan_template.c (M_DECL_FUNC (__ctan)): Set imaginary part of result to imaginary part of argument if it is zero and the real part of the argument is not finite. * math/s_ctanh_template.c (M_DECL_FUNC (__ctanh)): Set real part of result to real part of argument if it is zero and the imaginary part of the argument is not finite. --- ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index c48925a476..309ae53d73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2017-12-07 Joseph Myers + + [BZ #22568] + * math/s_ctan_template.c (M_DECL_FUNC (__ctan)): Set imaginary + part of result to imaginary part of argument if it is zero and the + real part of the argument is not finite. + * math/s_ctanh_template.c (M_DECL_FUNC (__ctanh)): Set real part + of result to real part of argument if it is zero and the imaginary + part of the argument is not finite. + 2017-12-07 Mike FABIAN [BZ #22524] -- cgit v1.2.3-70-g09d2