about summary refs log tree commit diff
path: root/sysdeps/libm-ieee754/s_ctanh.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/s_ctanh.c')
-rw-r--r--sysdeps/libm-ieee754/s_ctanh.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/libm-ieee754/s_ctanh.c b/sysdeps/libm-ieee754/s_ctanh.c
index eb6ff84817..d8825f35f9 100644
--- a/sysdeps/libm-ieee754/s_ctanh.c
+++ b/sysdeps/libm-ieee754/s_ctanh.c
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <complex.h>
+#include <fenv.h>
 #include <math.h>
 
 #include "math_private.h"
@@ -44,6 +45,11 @@ __ctanh (__complex__ double x)
 	{
 	  __real__ res = __nan ("");
 	  __imag__ res = __nan ("");
+
+#ifdef FE_INVALID
+	  if (__isinf (__imag__ x))
+	    feraiseexcept (FE_INVALID);
+#endif
 	}
     }
   else