about summary refs log tree commit diff
path: root/stdio-common/printf_fphex.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-08-23 11:57:52 -0700
committerUlrich Drepper <drepper@redhat.com>2009-08-23 11:57:52 -0700
commit003c9895a89e71767ad64bafac1ca99622be2eb7 (patch)
tree86902c3ea811ee8c4b8507a026f5563306340357 /stdio-common/printf_fphex.c
parent659a63fb7ba0b2c9bc45034283a302afe56a6ebe (diff)
downloadglibc-003c9895a89e71767ad64bafac1ca99622be2eb7.tar.gz
glibc-003c9895a89e71767ad64bafac1ca99622be2eb7.tar.xz
glibc-003c9895a89e71767ad64bafac1ca99622be2eb7.zip
Print sign of NaN values.
Diffstat (limited to 'stdio-common/printf_fphex.c')
-rw-r--r--stdio-common/printf_fphex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c
index 4e30d94c61..551c873c5e 100644
--- a/stdio-common/printf_fphex.c
+++ b/stdio-common/printf_fphex.c
@@ -172,6 +172,7 @@ __printf_fphex (FILE *fp,
       /* Check for special values: not a number or infinity.  */
       if (__isnanl (fpnum.ldbl.d))
 	{
+	  negative = fpnum.ldbl.ieee.negative != 0;
 	  if (isupper (info->spec))
 	    {
 	      special = "NAN";
@@ -182,7 +183,6 @@ __printf_fphex (FILE *fp,
 	      special = "nan";
 	      wspecial = L"nan";
 	    }
-	  negative = 0;
 	}
       else
 	{
@@ -211,6 +211,7 @@ __printf_fphex (FILE *fp,
       /* Check for special values: not a number or infinity.  */
       if (__isnan (fpnum.dbl.d))
 	{
+	  negative = fpnum.dbl.ieee.negative != 0;
 	  if (isupper (info->spec))
 	    {
 	      special = "NAN";
@@ -221,7 +222,6 @@ __printf_fphex (FILE *fp,
 	      special = "nan";
 	      wspecial = L"nan";
 	    }
-	  negative = 0;
 	}
       else
 	{