aboutsummaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJon Beniston <jon@beniston.com>2018-12-11 21:03:03 +0000
committerCorinna Vinschen <corinna@vinschen.de>2018-12-13 13:15:32 +0100
commitb3692aed5e48b6107afba6aab21d03191dc80117 (patch)
treedea231466195a7348fe11e1f1fd6e0507569f2f8 /newlib
parentdf6915f029ac9acd2b479ea898388cbd7dda4974 (diff)
downloadnewlib-b3692aed5e48b6107afba6aab21d03191dc80117.zip
newlib-b3692aed5e48b6107afba6aab21d03191dc80117.tar.gz
newlib-b3692aed5e48b6107afba6aab21d03191dc80117.tar.bz2
nano-vfprintf_float.c: Fix check if negative for nans.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/libc/stdio/nano-vfprintf_float.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/stdio/nano-vfprintf_float.c b/newlib/libc/stdio/nano-vfprintf_float.c
index 071a09e..524f67a 100644
--- a/newlib/libc/stdio/nano-vfprintf_float.c
+++ b/newlib/libc/stdio/nano-vfprintf_float.c
@@ -39,6 +39,7 @@
#include <string.h>
#include <limits.h>
#include <stdint.h>
+#include <math.h>
#include <wchar.h>
#include <sys/lock.h>
#include <stdarg.h>
@@ -213,7 +214,7 @@ _printf_float (struct _reent *data,
}
if (isnan (_fpvalue))
{
- if (_fpvalue < 0)
+ if (signbit (_fpvalue))
pdata->l_buf[0] = '-';
if (code <= 'G') /* 'A', 'E', 'F', or 'G'. */
cp = "NAN";