mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 23:28:29 +08:00
libm/copysign: respect signed zero/NaN in copysign
This commit is contained in:
committed by
Xiang Xiao
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user