Perform some code cleanup

This commit is contained in:
Justine Tunney 2023-05-15 16:32:10 -07:00
parent cc1732bc42
commit 210187cf77
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
205 changed files with 1748 additions and 2595 deletions

View file

@ -56,18 +56,18 @@ asm(".include \"libc/disclaimer.inc\"");
/**
* Returns 𝑥 × 2ʸ.
*/
double scalb(double x, double fn)
double scalb(double x, double y)
{
if (isunordered(x, fn))
return x*fn;
if (!isfinite(fn)) {
if (fn > 0.0)
return x*fn;
if (isunordered(x, y))
return x*y;
if (!isfinite(y)) {
if (y > 0.0)
return x*y;
else
return x/(-fn);
return x/(-y);
}
if (rint(fn) != fn) return (fn-fn)/(fn-fn);
if ( fn > 65000.0) return scalbn(x, 65000);
if (-fn > 65000.0) return scalbn(x,-65000);
return scalbn(x,(int)fn);
if (rint(y) != y) return (y-y)/(y-y);
if ( y > 65000.0) return scalbn(x, 65000);
if (-y > 65000.0) return scalbn(x,-65000);
return scalbn(x,(int)y);
}