1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:42:13 +00:00

LibM: Implement path for negative powers

This commit is contained in:
Hendiadyoin1 2021-05-11 18:36:59 +02:00 committed by Andreas Kling
parent 71fc7ac7ac
commit c74d7adac6

View file

@ -426,6 +426,10 @@ long double powl(long double x, long double y) NOEXCEPT
result = 1.0l / result;
return result;
}
if (x < 0) {
return 1.l / exp2l(y * log2l(-x));
}
return exp2l(y * log2l(x));
}