]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - math/s_clog_template.c
math: Remove bogus math implementations
[thirdparty/glibc.git] / math / s_clog_template.c
index 047ac03cd98be4ceaf7f7409f13628b411419474..0f95b24aa20da79a185abff59c07f8c7973e5f9c 100644 (file)
@@ -1,7 +1,6 @@
 /* Compute complex natural logarithm.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+   Copyright (C) 1997-2024 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <complex.h>
 #include <math.h>
 #include <math_private.h>
+#include <math-underflow.h>
 #include <float.h>
 
 CFLOAT
@@ -32,7 +32,7 @@ M_DECL_FUNC (__clog) (CFLOAT x)
   if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       /* Real and imaginary part are 0.0.  */
-      __imag__ result = signbit (__real__ x) ? (FLOAT) M_MLIT (M_PI) : 0;
+      __imag__ result = signbit (__real__ x) ? M_MLIT (M_PI) : 0;
       __imag__ result = M_COPYSIGN (__imag__ result, __imag__ x);
       /* Yes, the following line raises an exception.  */
       __real__ result = -1 / M_FABS (__real__ x);
@@ -94,7 +94,7 @@ M_DECL_FUNC (__clog) (CFLOAT x)
       else
        {
          FLOAT d = M_HYPOT (absx, absy);
-         __real__ result = M_LOG (d) - scale * (FLOAT) M_MLIT (M_LN2);
+         __real__ result = M_LOG (d) - scale * M_MLIT (M_LN2);
        }
 
       __imag__ result = M_ATAN2 (__imag__ x, __real__ x);
@@ -113,7 +113,3 @@ M_DECL_FUNC (__clog) (CFLOAT x)
 }
 
 declare_mgen_alias (__clog, clog)
-
-#if M_LIBM_NEED_COMPAT (clog)
-declare_mgen_libm_compat (__clog, clog)
-#endif