diff options
Diffstat (limited to 'stdio-common/printf_fp.c')
-rw-r--r-- | stdio-common/printf_fp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c index 3023b20..11f3145 100644 --- a/stdio-common/printf_fp.c +++ b/stdio-common/printf_fp.c @@ -332,7 +332,6 @@ ___printf_fp (FILE *fp, fpnum.ldbl = *(const long double *) args[0]; /* Check for special values: not a number or infinity. */ - int res; if (isnan (fpnum.ldbl)) { is_neg = signbit (fpnum.ldbl); @@ -347,9 +346,9 @@ ___printf_fp (FILE *fp, wspecial = L"nan"; } } - else if ((res = __isinfl (fpnum.ldbl))) + else if (isinf (fpnum.ldbl)) { - is_neg = res < 0; + is_neg = signbit (fpnum.ldbl); if (isupper (info->spec)) { special = "INF"; @@ -377,11 +376,9 @@ ___printf_fp (FILE *fp, fpnum.dbl = *(const double *) args[0]; /* Check for special values: not a number or infinity. */ - int res; if (isnan (fpnum.dbl)) { - union ieee754_double u = { .d = fpnum.dbl }; - is_neg = u.ieee.negative != 0; + is_neg = signbit (fpnum.dbl); if (isupper (info->spec)) { special = "NAN"; @@ -393,9 +390,9 @@ ___printf_fp (FILE *fp, wspecial = L"nan"; } } - else if ((res = __isinf (fpnum.dbl))) + else if (isinf (fpnum.dbl)) { - is_neg = res < 0; + is_neg = signbit (fpnum.dbl); if (isupper (info->spec)) { special = "INF"; |