libm/copysign: respect signed zero/NaN in copysign
This commit is contained in:
parent
b35f7aed48
commit
871cd306c5
|
@ -34,7 +34,7 @@
|
|||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
double copysign(double x, double y)
|
||||
{
|
||||
if (y < 0)
|
||||
if (signbit(y))
|
||||
{
|
||||
return -fabs(x);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#ifdef CONFIG_HAVE_LONG_DOUBLE
|
||||
long double copysignl(long double x, long double y)
|
||||
{
|
||||
if (y < 0)
|
||||
if (signbit(y))
|
||||
{
|
||||
return -fabsl(x);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue