X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fmath%2Fsqrt.c;h=b27756738595dc29a8a7f35e7bffa8da64214826;hp=2ebd022b0c3cb73ca4300fb5da24072f7a61da1f;hb=fcfba99503746e44585d7e318562dd425e8ff390;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd diff --git a/src/math/sqrt.c b/src/math/sqrt.c index 2ebd022b..b2775673 100644 --- a/src/math/sqrt.c +++ b/src/math/sqrt.c @@ -78,7 +78,7 @@ #include "libm.h" -static const double one = 1.0, tiny = 1.0e-300; +static const double tiny = 1.0e-300; double sqrt(double x) { @@ -161,13 +161,13 @@ double sqrt(double x) /* use floating add to find out rounding direction */ if ((ix0|ix1) != 0) { - z = one - tiny; /* raise inexact flag */ - if (z >= one) { - z = one + tiny; + z = 1.0 - tiny; /* raise inexact flag */ + if (z >= 1.0) { + z = 1.0 + tiny; if (q1 == (uint32_t)0xffffffff) { q1 = 0; q++; - } else if (z > one) { + } else if (z > 1.0) { if (q1 == (uint32_t)0xfffffffe) q++; q1 += 2;