aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2013-02-16 00:15:57 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2013-02-16 00:15:57 +0530
commit22af19f9fb1909690dbe9840c0de093b656b4a68 (patch)
treea21f036eb56c8c5ca7ee00a6bc3f66d565e375ba /sysdeps/ieee754/dbl-64
parent4709fe7602b56e9f6ee1ab6afb4067409a784f29 (diff)
downloadglibc-22af19f9fb1909690dbe9840c0de093b656b4a68.tar
glibc-22af19f9fb1909690dbe9840c0de093b656b4a68.tar.gz
glibc-22af19f9fb1909690dbe9840c0de093b656b4a68.tar.bz2
glibc-22af19f9fb1909690dbe9840c0de093b656b4a68.zip
Don't require LIM to determine loop end in __sqr
Diffstat (limited to 'sysdeps/ieee754/dbl-64')
-rw-r--r--sysdeps/ieee754/dbl-64/mpa.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sysdeps/ieee754/dbl-64/mpa.c b/sysdeps/ieee754/dbl-64/mpa.c
index 9da4257263..1f60fa5a6d 100644
--- a/sysdeps/ieee754/dbl-64/mpa.c
+++ b/sysdeps/ieee754/dbl-64/mpa.c
@@ -747,12 +747,9 @@ __sqr (const mp_no *x, mp_no *y, int p)
long lim = k / 2;
if (k % 2 == 0)
- {
- yk += X[lim] * X[lim];
- lim--;
- }
+ yk += X[lim] * X[lim];
- for (i = k - p, j = p; i <= lim; i++, j--)
+ for (i = k - p, j = p; i < j; i++, j--)
yk2 += X[i] * X[j];
yk += 2.0 * yk2;
@@ -770,12 +767,9 @@ __sqr (const mp_no *x, mp_no *y, int p)
long lim = k / 2;
if (k % 2 == 0)
- {
- yk += X[lim] * X[lim];
- lim--;
- }
+ yk += X[lim] * X[lim];
- for (i = 1, j = k - 1; i <= lim; i++, j--)
+ for (i = 1, j = k - 1; i < j; i++, j--)
yk2 += X[i] * X[j];
yk += 2.0 * yk2;