libstdc++/99: ostream setw and width breaks double/float output
evan.harris@dsto.defence.gov.au
evan.harris@dsto.defence.gov.au
Tue Oct 31 18:07:00 GMT 2000
>Number: 99
>Category: libstdc++
>Synopsis: ostream setw and width breaks double/float output
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Oct 31 18:07:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: evan.harris@dsto.defence.gov.au
>Release: 2.10 (debian packages libstdc++2.10-glibc2.2, libstdc++2.10-dev)
>Organization:
>Environment:
Linux battlezone 2.2.17 #1 SMP Wed Aug 9 13:02:12 EST 2000 i686 unknown
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
>Description:
Setting the field width of an output stream via width
or the setw manipulator results in floating point numbers
not being output correctly. Null characters are output
at inappropriate points.
>How-To-Repeat:
$ cat > x.cc
#include <iostream>
#include <iomanip>
int
main(int, char**)
{
cout << setfill('_') << setw(20) << 3.14159 << endl;
return 0;
}
$ g++ x.cc
$ ./a.out | cat -v
^@^@^@^@^@^@^@^@^@^@^@^@^@3^@^@^@.^@^@
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Libstdc++-prs
mailing list