From 003c9895a89e71767ad64bafac1ca99622be2eb7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 23 Aug 2009 11:57:52 -0700 Subject: Print sign of NaN values. --- stdio-common/printf_fphex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stdio-common/printf_fphex.c') 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 { -- cgit 1.4.1