]> sourceware.org Git - newlib-cygwin.git/commitdiff
nano-vfprintf_float.c: Fix check if negative for nans.
authorJon Beniston <jon@beniston.com>
Tue, 11 Dec 2018 21:03:03 +0000 (21:03 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 13 Dec 2018 12:15:32 +0000 (13:15 +0100)
newlib/libc/stdio/nano-vfprintf_float.c

index 071a09edc60504c6105b5c08a2c21a634d144804..524f67a31383b165245fb3e804f33995fbdbacf4 100644 (file)
@@ -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";
This page took 0.030671 seconds and 5 git commands to generate.