summary refs log tree commit diff
path: root/sysdeps/libm-ieee754
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754')
-rw-r--r--sysdeps/libm-ieee754/s_ctan.c6
-rw-r--r--sysdeps/libm-ieee754/s_ctanf.c6
-rw-r--r--sysdeps/libm-ieee754/s_ctanl.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/sysdeps/libm-ieee754/s_ctan.c b/sysdeps/libm-ieee754/s_ctan.c
index c68c3ad3e4..f1ce9688bb 100644
--- a/sysdeps/libm-ieee754/s_ctan.c
+++ b/sysdeps/libm-ieee754/s_ctan.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 @@ __ctan (__complex__ double x)
 	{
 	  __real__ res = __nan ("");
 	  __imag__ res = __nan ("");
+
+#ifdef FE_INVALID
+	  if (__isinf (__real__ x))
+	    feraiseexcept (FE_INVALID);
+#endif
 	}
     }
   else
diff --git a/sysdeps/libm-ieee754/s_ctanf.c b/sysdeps/libm-ieee754/s_ctanf.c
index 4209587b37..750d3511b9 100644
--- a/sysdeps/libm-ieee754/s_ctanf.c
+++ b/sysdeps/libm-ieee754/s_ctanf.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 @@ __ctanf (__complex__ float x)
 	{
 	  __real__ res = __nanf ("");
 	  __imag__ res = __nanf ("");
+
+#ifdef FE_INVALID
+	  if (__isinff (__real__ x))
+	    feraiseexcept (FE_INVALID);
+#endif
 	}
     }
   else
diff --git a/sysdeps/libm-ieee754/s_ctanl.c b/sysdeps/libm-ieee754/s_ctanl.c
index 88c02da2ea..31ab3b48a6 100644
--- a/sysdeps/libm-ieee754/s_ctanl.c
+++ b/sysdeps/libm-ieee754/s_ctanl.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 @@ __ctanl (__complex__ long double x)
 	{
 	  __real__ res = __nanl ("");
 	  __imag__ res = __nanl ("");
+
+#ifdef FE_INVALID
+	  if (__isinfl (__real__ x))
+	    feraiseexcept (FE_INVALID);
+#endif
 	}
     }
   else