aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/printf_fphex.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-06-07 15:57:26 +0000
committerUlrich Drepper <drepper@redhat.com>1999-06-07 15:57:26 +0000
commit263456bdd443ebe492e8389fc500c6a28342793c (patch)
treeff40c7da398d8a1e2b1a822a86af4dadb75c5409 /sysdeps/generic/printf_fphex.c
parentf21aa4c28f70da7efccf44f4be0d5239ac0aa711 (diff)
downloadglibc-263456bdd443ebe492e8389fc500c6a28342793c.tar
glibc-263456bdd443ebe492e8389fc500c6a28342793c.tar.gz
glibc-263456bdd443ebe492e8389fc500c6a28342793c.tar.bz2
glibc-263456bdd443ebe492e8389fc500c6a28342793c.zip
Update.
1999-06-07 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/unix/sysv/linux/if_index.c: Use SIGIOCGIFINDEX and fix another SIOGIFNAME typo. 1999-06-07 Ulrich Drepper <drepper@cygnus.com> * elf/dl-lookup.c: Remove duplicated assert.h inclusion. * sysdeps/generic/printf_fphex.c (__printf_fphex): Optimize a little bit. 1999-06-05 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * sysdeps/generic/printf_fphex.c (__printf_fphex): Don't ignore the precision if the mantissa is zero. 1999-06-05 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * manual/lang.texi (Floating Point Parameters): GCC already supports long double for a long time. 1999-06-05 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * math/libm-test.c (j0_test, j1_test, jn_test, y0_test, y1_test, yn_test): Increase some epsilons.
Diffstat (limited to 'sysdeps/generic/printf_fphex.c')
-rw-r--r--sysdeps/generic/printf_fphex.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sysdeps/generic/printf_fphex.c b/sysdeps/generic/printf_fphex.c
index 00dd8eed1d..b30622080c 100644
--- a/sysdeps/generic/printf_fphex.c
+++ b/sysdeps/generic/printf_fphex.c
@@ -405,7 +405,11 @@ __printf_fphex (FILE *fp,
}
}
else
- numend = numstr;
+ {
+ if (precision == -1)
+ precision = 0;
+ numend = numstr;
+ }
/* Now we can compute the exponent string. */
expstr = _itoa_word (exponent, expbuf + sizeof expbuf, 10, 0);
@@ -420,7 +424,7 @@ __printf_fphex (FILE *fp,
/* A special case when the mantissa or the precision is zero and the `#'
is not given. In this case we must not print the decimal point. */
- if ((zero_mantissa || precision == 0) && !info->alt)
+ if (precision == 0 && !info->alt)
++width; /* This nihilates the +1 for the decimal-point
character in the following equation. */
@@ -435,13 +439,16 @@ __printf_fphex (FILE *fp,
outchar (' ');
outchar ('0');
- outchar (info->spec == 'A' ? 'X' : 'x');
+ if ('X' - 'A' == 'x' - 'a')
+ outchar (info->spec + ('x' - 'a'));
+ else
+ outchar (info->spec == 'A' ? 'X' : 'x');
outchar (leading);
- if ((!zero_mantissa && precision > 0) || info->alt)
+ if (precision > 0 || info->alt)
outchar (decimal);
- if (!zero_mantissa && precision > 0)
+ if (precision > 0)
{
PRINT (numstr, MIN (numend - numstr, precision));
if (precision > numend - numstr)
@@ -451,7 +458,10 @@ __printf_fphex (FILE *fp,
if (info->left && info->pad == '0' && width > 0)
PADN ('0', width);
- outchar (info->spec == 'A' ? 'P' : 'p');
+ if ('P' - 'A' == 'p' - 'a')
+ outchar (info->spec + ('p' - 'a'));
+ else
+ outchar (info->spec == 'A' ? 'P' : 'p');
outchar (expnegative ? '-' : '+');