diff options
-rw-r--r-- | newlib/libc/stdio/nano-vfprintf_float.c | 3 |
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 071a09edc..524f67a31 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"; |