aboutsummaryrefslogtreecommitdiff
path: root/src/math/remquol.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-05-10 22:25:14 -0400
committerRich Felker <dalias@aerifal.cx>2012-05-10 22:25:14 -0400
commit9cfa3065c576e83949d659df0bba59e901671bc3 (patch)
treee694573164b6ca1a2123cc2bc4b429a62f3acaa2 /src/math/remquol.c
parentremove __lock dependency from exit (diff)
parentmath: fix remquo.c when x==-y and a subnormal remainder bug as well (diff)
downloadgrovel-9cfa3065c576e83949d659df0bba59e901671bc3.tar.gz
grovel-9cfa3065c576e83949d659df0bba59e901671bc3.tar.xz
Merge remote-tracking branch 'nsz/master'
Diffstat (limited to 'src/math/remquol.c')
-rw-r--r--src/math/remquol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/math/remquol.c b/src/math/remquol.c
index 721231b4..a2e11728 100644
--- a/src/math/remquol.c
+++ b/src/math/remquol.c
@@ -94,7 +94,7 @@ long double remquol(long double x, long double y, int *quo)
goto fixup; /* |x|<|y| return x or x-y */
}
if (ux.bits.manh == uy.bits.manh && ux.bits.manl == uy.bits.manl) {
- *quo = 1;
+ *quo = sxy ? -1 : 1;
return Zero[sx]; /* |x|=|y| return x*0*/
}
}
@@ -152,6 +152,7 @@ long double remquol(long double x, long 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[sx];
}