X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fmath%2Fremquol.c;h=a2e11728169d3c74dcd3676f3919b62c10cd939a;hp=dd18f35c283b4e1a46832c002026b4fdb4498aa4;hb=3738a96e052603403e085e9a1024289ba3e09188;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd diff --git a/src/math/remquol.c b/src/math/remquol.c index dd18f35c..a2e11728 100644 --- a/src/math/remquol.c +++ b/src/math/remquol.c @@ -48,7 +48,7 @@ typedef uint32_t manh_t; #define MANL_SHIFT (LDBL_MANL_SIZE - 1) -static const long double Zero[] = {0.0L, -0.0L}; +static const long double Zero[] = {0.0, -0.0}; /* * Return the IEEE remainder and set *quo to the last n bits of the @@ -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]; }