mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibM: Add naive implementation of copysign()
This commit is contained in:
parent
fc5b252010
commit
9f8a9dba0b
Notes:
sideshowbarker
2024-07-18 21:41:49 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9f8a9dba0b5
|
@ -742,4 +742,15 @@ long double nexttowardl(long double, long double) NOEXCEPT
|
|||
{
|
||||
TODO();
|
||||
}
|
||||
|
||||
double copysign(double x, double y)
|
||||
{
|
||||
if (x < 0 && y < 0)
|
||||
return x;
|
||||
if (x >= 0 && y < 0)
|
||||
return -x;
|
||||
if (x < 0 && y >= 0)
|
||||
return -x;
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,4 +143,6 @@ double nexttoward(double, long double) NOEXCEPT;
|
|||
float nexttowardf(float, long double) NOEXCEPT;
|
||||
long double nexttowardl(long double, long double) NOEXCEPT;
|
||||
|
||||
double copysign(double x, double y);
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Reference in a new issue