This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/28278] formatted I/O and calliing width(0)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28278

Michael <mikeus at hotmail dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikeus at hotmail dot ru

--- Comment #1 from Michael <mikeus at hotmail dot ru> 2010-12-27 11:25:51 UTC ---
Can anybody fix this bug?

------- code: -------
#include<iostream>
using namespace std;

int main()
{
  cout.setf(ios_base::fixed);
  cout.precision(3);
  cout.width(20);
  cout.fill('#');

  cout << (double)1.123456789 << endl;
  cout << (double)0.123456789 << endl;
  cout << (double)10.123456789 << endl;
}
---------------------

------- output: -------
###############1.123
0.123
10.123
-----------------------

------- expected: -------
###############1.123
###############0.123
##############10.123
-------------------------

It's just sad... :^(((


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