| www.delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f |
| From: | "Alex Vinokur" <alexvn AT bigfoot DOT com> |
| Newsgroups: | comp.lang.c++,comp.os.msdos.djgpp |
| Subject: | setw & notation |
| Date: | Tue, 23 Apr 2002 12:00:57 +0200 |
| Organization: | Scopus |
| Lines: | 82 |
| Message-ID: | <aa37pj$79p7q$1@ID-79865.news.dfncis.de> |
| NNTP-Posting-Host: | gateway.scopus.net (62.90.123.5) |
| X-Trace: | fu-berlin.de 1019552371 7660794 62.90.123.5 (16 [79865]) |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Newsreader: | Microsoft Outlook Express 6.00.2600.0000 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
=========================================================
GNU CPP version 3.0.4 (cpplib) (80386, BSD syntax)
GNU C++ version 3.0.4 (djgpp) compiled by GNU C version 3.0.4.
Configured with: ../configure i586-pc-msdosdjgpp --prefix=/dev/env/DJDIR --disable-nls
Thread model: single
Windows-2000
=========================================================
Here is a program and its run-results.
Any explanation?
Thanks in advance.
###### Source C-file : BEGIN ######
// File t2.cpp
#include <iostream>
#include <iomanip>
using namespace std;
// -----------------------
template <typename T1>
void show_it (
unsigned int show_size_i,
const T1& value_i
)
{
cout.setf (ios::right, ios::adjustfield);
cout << setw (show_size_i) << value_i << endl;
}
// -----------------------
int main ()
{
#define SHOW_SIZE_CNS 15
show_it (SHOW_SIZE_CNS, 0.1);
show_it (SHOW_SIZE_CNS, 0.02);
show_it (SHOW_SIZE_CNS, 0.003);
show_it (SHOW_SIZE_CNS, 0.0004);
show_it (SHOW_SIZE_CNS, 0.00005);
show_it (SHOW_SIZE_CNS, 0.000006);
return 0;
}
###### Source C-file : END ########
###### Compilation & Run : BEGIN ######
%gpp t2.cpp
%a.exe
0.1
0.02
0.003
0.0004
5e-05 || MY COMMENT : Why not 0.00005 ?
6e-06 || MY COMMENT : Why not 0.000006 ?
###### Compilation & Run : END ########
--
====================
Alex Vinokur
http://up.to/alexvn
http://go.to/alexv_math
mailto:alexvn AT bigfoot DOT com
mailto:alexvn AT go DOT to
====================
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |