mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +08:00
libm/copysign: respect signed zero/NaN in copysign
This commit is contained in:
parent
b35f7aed48
commit
871cd306c5
2 changed files with 2 additions and 2 deletions
|
@ -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 a new issue