Work around lseek bug on BeOS.
[gnulib.git] / lib / atanl.c
index 16c8dc1..3f8bda4 100644 (file)
@@ -64,6 +64,7 @@
  *
  */
 
+#include "isnanl.h"
 
 /* arctan(k/8), k = 0, ..., 82 */
 static const long double atantbl[84] = {
@@ -178,12 +179,12 @@ atanl (long double x)
   int k, sign;
   long double t, u, p, q;
 
-  sign = x < 0.0;
-
   /* Check for zero or NaN.  */
-  if (x != x || x == 0.0)
+  if (isnanl (x) || x == 0.0)
     return x + x;
 
+  sign = x < 0.0;
+
   if (x + x == x)
     {
       /* Infinity. */