/* Complex tangent function for a complex float type.
- Copyright (C) 1997-2017 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 <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 <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
CFLOAT
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);