1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

isinf returns the sign of the number, use it in printf*

This commit is contained in:
Ulrich Drepper
2011-10-08 08:22:44 -04:00
parent 9277c06437
commit 187da0aedc
4 changed files with 32 additions and 23 deletions

View File

@ -180,7 +180,8 @@ __printf_fphex (FILE *fp,
}
else
{
if (__isinfl (fpnum.ldbl.d))
int res = __isinfl (fpnum.ldbl.d);
if (res)
{
if (isupper (info->spec))
{
@ -192,9 +193,10 @@ __printf_fphex (FILE *fp,
special = "inf";
wspecial = L"inf";
}
negative = res < 0;
}
negative = signbit (fpnum.ldbl.d);
else
negative = signbit (fpnum.ldbl.d);
}
}
else
@ -219,7 +221,8 @@ __printf_fphex (FILE *fp,
}
else
{
if (__isinf (fpnum.dbl.d))
int res = __isinf (fpnum.dbl.d);
if (res)
{
if (isupper (info->spec))
{
@ -231,9 +234,10 @@ __printf_fphex (FILE *fp,
special = "inf";
wspecial = L"inf";
}
negative = res < 0;
}
negative = signbit (fpnum.dbl.d);
else
negative = signbit (fpnum.dbl.d);
}
}