diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-03-19 22:07:43 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-03-19 22:07:43 -0400 |
commit | 97721a5508415a2f10eb068e022093811c9ff8be (patch) | |
tree | 88e9ce153895ad949576fa7ce1eeee4b02286479 /src/math/sqrtf.c | |
parent | acb744921b73f5a73803e533e5e4a4896d164a26 (diff) | |
parent | 0cbb65479147ecdaa664e88cc2a5a925f3de502f (diff) | |
download | musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.gz musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.bz2 musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.xz musl-97721a5508415a2f10eb068e022093811c9ff8be.zip |
Merge remote branch 'nsz/master'
Diffstat (limited to 'src/math/sqrtf.c')
-rw-r--r-- | src/math/sqrtf.c | 10 |
1 files changed, 5 insertions, 5 deletions
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; |