Fix logic botch causing warnings with Clang. Reported by dhill, matches
authormiod <miod@openbsd.org>
Thu, 22 Jan 2015 21:18:56 +0000 (21:18 +0000)
committermiod <miod@openbsd.org>
Thu, 22 Jan 2015 21:18:56 +0000 (21:18 +0000)
similar changes in FreeBSD a few years ago.

lib/libm/src/e_asin.c
lib/libm/src/e_asinf.c

index db114c2..226addc 100644 (file)
@@ -80,12 +80,12 @@ asin(double x)
        } else if (ix<0x3fe00000) {     /* |x|<0.5 */
            if(ix<0x3e400000) {         /* if |x| < 2**-27 */
                if(huge+x>one) return x;/* return x with inexact if x!=0*/
-           } else 
-               t = x*x;
-               p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
-               q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
-               w = p/q;
-               return x+x*w;
+           }
+           t = x*x;
+           p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
+           q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
+           w = p/q;
+           return x+x*w;
        }
        /* 1> |x|>= 0.5 */
        w = one-fabs(x);
index 5df02a8..05b3292 100644 (file)
@@ -49,12 +49,12 @@ asinf(float x)
        } else if (ix<0x3f000000) {     /* |x|<0.5 */
            if(ix<0x32000000) {         /* if |x| < 2**-27 */
                if(huge+x>one) return x;/* return x with inexact if x!=0*/
-           } else 
-               t = x*x;
-               p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
-               q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
-               w = p/q;
-               return x+x*w;
+           }
+           t = x*x;
+           p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
+           q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
+           w = p/q;
+           return x+x*w;
        }
        /* 1> |x|>= 0.5 */
        w = one-fabsf(x);