fix iconv conversion to legacy 8bit codepages
[musl] / src / math / hypotf.c
index 40acd91..4d80178 100644 (file)
@@ -40,7 +40,7 @@ float hypotf(float x, float y)
        if (ha > 0x58800000) {    /* a > 2**50 */
                if(ha >= 0x7f800000) {  /* Inf or NaN */
                        /* Use original arg order iff result is NaN; quieten sNaNs. */
-                       w = fabsf(x+0.0F) - fabsf(y+0.0F);
+                       w = fabsf(x+0.0f) - fabsf(y+0.0f);
                        if (ha == 0x7f800000) w = a;
                        if (hb == 0x7f800000) w = b;
                        return w;
@@ -80,9 +80,7 @@ float hypotf(float x, float y)
                t2 = a - t1;
                w  = sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b)));
        }
-       if (k != 0) {
-               SET_FLOAT_WORD(t1, 0x3f800000+(k<<23));
-               return t1*w;
-       }
+       if (k)
+               w = scalbnf(w, k);
        return w;
 }