mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Handle more pow cases (#61)
This commit is contained in:
parent
1a08594f95
commit
43b2475aaa
6 changed files with 45 additions and 21 deletions
|
@ -31,7 +31,11 @@ long double powl(long double x, long double y) {
|
|||
asm("fprem" : "=t"(t) : "0"(u), "u"(1.L));
|
||||
asm("f2xm1" : "=t"(t) : "0"(t));
|
||||
asm("fscale" : "=t"(t) : "0"(t + 1), "u"(u));
|
||||
return copysignl(t, x);
|
||||
if (signbit(x)) {
|
||||
if (y != truncl(y)) return -NAN;
|
||||
if (!signbit(y) || ((int64_t)y & 1)) t = -t;
|
||||
}
|
||||
return t;
|
||||
} else if (y > 0) {
|
||||
return 0;
|
||||
} else if (!y) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue