This is the mail archive of the
libstdc++-prs@sources.redhat.com
mailing list for the libstdc++ project.
libstdc++/99: ostream setw and width breaks double/float output
- To: libstdc++-gnats at sourceware dot cygnus dot com
- Subject: libstdc++/99: ostream setw and width breaks double/float output
- From: evan dot harris at dsto dot defence dot gov dot au
- Date: 1 Nov 2000 02:05:22 -0000
- Reply-To: evan dot harris at dsto dot defence dot gov dot au
- Resent-Cc: libstdc++-prs at sourceware dot cygnus dot com
- Resent-Reply-To: libstdc++-gnats@sourceware.cygnus.com, evan.harris@dsto.defence.gov.au
>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: