This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fprintf Family for Formatted Output


Ulrich kindly addressed my concerns about this subject
several years ago, but I would like to hear a current view:

The question I had was why gcc and glibc showed a negative
sign for a result which rounds to zero on output when
compilers from Sun, SGI, and VAX didn't.  If I remembered
correctly, Ulrich said it was because of POSIX compiliance.

For example, take a value of -0.0001. Display the value
using
fprintf:

  fprintf(stderr, "%.2f", -0.0001);

The other compilers mentioned will output "0.00"
while gcc will output: "-0.00".

Is there any hope for a GNU extension (or compiler build
option) to get that behavior?

Thanks.

Tom Browder

P.S.  The original rationale for wanting the behavior was
to eliminate insignificant differences in printed output so
the gcc version of legacy programs could be validated.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]