LibM: Implement path for negative powers
This commit is contained in:
parent
71fc7ac7ac
commit
c74d7adac6
Notes:
sideshowbarker
2024-07-18 11:06:39 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/c74d7adac6b Pull-request: https://github.com/SerenityOS/serenity/pull/8361 Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 0 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue