mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +00:00
LibM: Add naive implementation of copysign()
This commit is contained in:
parent
fc5b252010
commit
9f8a9dba0b
2 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue