Skip to content

Commit

Permalink
k_rem_pio2.c: fix typo in second memset(): iq, not q. fixes bug #5309.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Oct 8, 2020
1 parent 061256a commit 54bb9aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/libm/k_rem_pio2.c
Expand Up @@ -173,8 +173,8 @@ int32_t attribute_hidden __kernel_rem_pio2(const double *x, double *y, int e0, i
j = jv-jx; m = jx+jk;
for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j];
if ((m+1) < SDL_arraysize(f)) {
SDL_memset(&f[m+1], 0, sizeof (f) - ((m+1) * sizeof (f[0])));
}
SDL_memset(&f[m+1], 0, sizeof (f) - ((m+1) * sizeof (f[0])));
}

/* compute q[0],q[1],...q[jk] */
for (i=0;i<=jk;i++) {
Expand All @@ -191,8 +191,8 @@ int32_t attribute_hidden __kernel_rem_pio2(const double *x, double *y, int e0, i
z = q[j-1]+fw;
}
if (jz < SDL_arraysize(iq)) {
SDL_memset(&iq[jz], 0, sizeof (q) - (jz * sizeof (iq[0])));
}
SDL_memset(&iq[jz], 0, sizeof (iq) - (jz * sizeof (iq[0])));
}

/* compute n */
z = scalbn(z,q0); /* actual value of z */
Expand Down Expand Up @@ -276,8 +276,8 @@ int32_t attribute_hidden __kernel_rem_pio2(const double *x, double *y, int e0, i
fq[jz-i] = fw;
}
if ((jz+1) < SDL_arraysize(f)) {
SDL_memset(&fq[jz+1], 0, sizeof (fq) - ((jz+1) * sizeof (fq[0])));
}
SDL_memset(&fq[jz+1], 0, sizeof (fq) - ((jz+1) * sizeof (fq[0])));
}

/* compress fq[] into y[] */
switch(prec) {
Expand Down

0 comments on commit 54bb9aa

Please sign in to comment.