X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fhypotf.c;h=4d80178de11216c0efa515be57f3ba515c7b9294;hb=50d9661d9b231f503b21e9d8787d1411b864d58a;hp=40acd917d17fb96c9e18ef117885473fd1d48056;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd;p=musl diff --git a/src/math/hypotf.c b/src/math/hypotf.c index 40acd917..4d80178d 100644 --- a/src/math/hypotf.c +++ b/src/math/hypotf.c @@ -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; }