X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fremquof.c;h=536a050aa596558158eb825a8dd58f799412beb2;hb=ae4b0b96d63fe3cbd70008350f998570c9e91f7f;hp=11569ce8a386a892913c1121bc66585f1fd9434a;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd;p=musl diff --git a/src/math/remquof.c b/src/math/remquof.c index 11569ce8..536a050a 100644 --- a/src/math/remquof.c +++ b/src/math/remquof.c @@ -41,7 +41,7 @@ float remquof(float x, float y, int *quo) q = 0; goto fixup; } else if(hx==hy) { /* |x| = |y| return x*0*/ - *quo = 1; + *quo = sxy ? -1 : 1; return Zero[(uint32_t)sx>>31]; } @@ -92,6 +92,7 @@ float remquof(float x, float y, int *quo) /* convert back to floating value and restore the sign */ if (hx == 0) { /* return sign(x)*0 */ + q &= 0x7fffffff; *quo = sxy ? -q : q; return Zero[(uint32_t)sx>>31]; }