X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=math%2Fs_ctan_template.c;h=aabdcd57c167a4f3ce2467b0ba1bf1b98b6af900;hb=72ab1eaec7e46cdb6c4f37fb687a7a593f93020a;hp=96efa47465b766db79770e909dd489779c3a4009;hpb=d5602cebf1ff25ef34298a52209283879609ec16;p=thirdparty%2Fglibc.git diff --git a/math/s_ctan_template.c b/math/s_ctan_template.c index 96efa47465b..aabdcd57c16 100644 --- a/math/s_ctan_template.c +++ b/math/s_ctan_template.c @@ -1,7 +1,6 @@ /* Complex tangent function for a complex float type. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -15,12 +14,13 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - . */ + . */ #include #include #include #include +#include #include CFLOAT @@ -49,7 +49,10 @@ M_DECL_FUNC (__ctan) (CFLOAT x) else { __real__ res = M_NAN; - __imag__ res = M_NAN; + if (__imag__ x == 0) + __imag__ res = __imag__ x; + else + __imag__ res = M_NAN; if (isinf (__real__ x)) feraiseexcept (FE_INVALID); @@ -124,7 +127,3 @@ M_DECL_FUNC (__ctan) (CFLOAT x) } declare_mgen_alias (__ctan, ctan) - -#if M_LIBM_NEED_COMPAT (ctan) -declare_mgen_libm_compat (__ctan, ctan) -#endif