Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!wuarchive!uunet!mcsun!hp4nl!sci.kun.nl!atcmpe!leo From: leo@atcmp.nl (@ Leo Willems) Newsgroups: comp.lang.c++ Subject: Re: bug in iostream? Summary: no it is not a bug Keywords: iostream format Message-ID: <879@atcmpe.atcmp.nl> Date: 7 Feb 91 16:36:48 GMT References: <875@atcmpe.atcmp.nl> Organization: AT Computing, Nijmegen, The Netherlands Lines: 49 In article <875@atcmpe.atcmp.nl>, leo@atcmp.nl (@ Leo Willems) writes: > When compiling the next program under cfron ports 2.0 and 2.1 the output > in both cases is not what I expect it to be: > > #include > > main() > { > cout.setf(ios::showpoint); > cout.precision(3); > > cout << 0.1 << endl << 1.1 << endl; > } > > Output: > > 0.100 > 1.10 > > The extra 0 from 0.1 is a little too much :-( > > Is this a known bug, or am I wrong? In both cases, is there a fix? Since a while I think it is not a bug, I didn't understand ios::precision(). What I want is this: given some floats I want them to be inserted in a stream in a columnwise fashion (like printf "%8.3f") i.e.: .... some statements setting the format cout <