summaryrefslogtreecommitdiff
path: root/src/math/sqrtf.c
diff options
context:
space:
mode:
authornsz <nsz@port70.net>2012-03-19 23:41:19 +0100
committernsz <nsz@port70.net>2012-03-19 23:41:19 +0100
commit0cbb65479147ecdaa664e88cc2a5a925f3de502f (patch)
tree7b6dc53fcec6497d55746d3cc47f167a20b7aa57 /src/math/sqrtf.c
parentb03255af77776703c8d48819e824d09f6f54ba86 (diff)
downloadmusl-0cbb65479147ecdaa664e88cc2a5a925f3de502f.tar.gz
code cleanup of named constants
zero, one, two, half are replaced by const literals The policy was to use the f suffix for float consts (1.0f), but don't use suffix for long double consts (these consts can be exactly represented as double).
Diffstat (limited to 'src/math/sqrtf.c')
-rw-r--r--src/math/sqrtf.c10
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;