X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fmath%2Fsqrtf.c;h=28cb4ad3713e6447843631a8d4e686f0f1dfdbb9;hp=35c24e50d34e86f8c5f4d1108f3d37b669e78d28;hb=be81f51030d90de8d5eb0b65dbdab3032d5cae23;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd diff --git a/src/math/sqrtf.c b/src/math/sqrtf.c index 35c24e50..28cb4ad3 100644 --- a/src/math/sqrtf.c +++ b/src/math/sqrtf.c @@ -15,7 +15,7 @@ #include "libm.h" -static const float one = 1.0, tiny = 1.0e-30; +static const float tiny = 1.0e-30; float sqrtf(float x) { @@ -68,10 +68,10 @@ float sqrtf(float x) /* use floating add to find out rounding direction */ if (ix != 0) { - z = one - tiny; /* raise inexact flag */ - if (z >= one) { - z = one + tiny; - if (z > one) + z = 1.0f - tiny; /* raise inexact flag */ + if (z >= 1.0f) { + z = 1.0f + tiny; + if (z > 1.0f) q += 2; else q += q & 1;