summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/s_remquo.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msun/src/s_remquo.c')
-rw-r--r--lib/msun/src/s_remquo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/msun/src/s_remquo.c b/lib/msun/src/s_remquo.c
index a64277a..d811c69 100644
--- a/lib/msun/src/s_remquo.c
+++ b/lib/msun/src/s_remquo.c
@@ -51,7 +51,7 @@ remquo(double x, double y, int *quo)
goto fixup; /* |x|<|y| return x or x-y */
}
if(lx==ly) {
- *quo = 1;
+ *quo = (sxy ? -1 : 1);
return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/
}
}
@@ -114,6 +114,7 @@ remquo(double x, double y, int *quo)
/* convert back to floating value and restore the sign */
if((hx|lx)==0) { /* return sign(x)*0 */
+ q &= 0x7fffffff;
*quo = (sxy ? -q : q);
return Zero[(u_int32_t)sx>>31];
}
@@ -129,9 +130,9 @@ remquo(double x, double y, int *quo)
lx = (lx>>n)|((u_int32_t)hx<<(32-n));
hx >>= n;
} else if (n<=31) {
- lx = (hx<<(32-n))|(lx>>n); hx = sx;
+ lx = (hx<<(32-n))|(lx>>n); hx = 0;
} else {
- lx = hx>>(n-32); hx = sx;
+ lx = hx>>(n-32); hx = 0;
}
}
fixup:
OpenPOWER on IntegriCloud