diff --git a/libs/libm/libm/lib_copysign.c b/libs/libm/libm/lib_copysign.c index f0b6c8ad3b..171b476aaa 100644 --- a/libs/libm/libm/lib_copysign.c +++ b/libs/libm/libm/lib_copysign.c @@ -34,7 +34,7 @@ #ifdef CONFIG_HAVE_DOUBLE double copysign(double x, double y) { - if (y < 0) + if (signbit(y)) { return -fabs(x); } diff --git a/libs/libm/libm/lib_copysignl.c b/libs/libm/libm/lib_copysignl.c index 58d3a32067..824403904d 100644 --- a/libs/libm/libm/lib_copysignl.c +++ b/libs/libm/libm/lib_copysignl.c @@ -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); }