mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Perform some code cleanup
This commit is contained in:
parent
cc1732bc42
commit
210187cf77
205 changed files with 1748 additions and 2595 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue