delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/18/13:56:55

Message-ID: <37921554.5975862E@pacificnet.net>
Date: Sun, 18 Jul 1999 10:56:36 -0700
From: Ralph Gesler <rgesler AT pacificnet DOT net>
X-Mailer: Mozilla 4.5 [en] (Win95; U)
X-Accept-Language: en,ja
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: cout with double number
References: <7mo06p$gj2$1 AT wanadoo DOT fr>
Reply-To: djgpp AT delorie DOT com

gb wrote:
> 
> hello
> 
> i wrote the program:
> .....
> double pi= 3.14159265358979;
> ....
> { cout << pi; }
> 
> in the screen :  3.14159
> 
> a) Where are the other digits ?
>     Someone told me to put "cout.width(number);" before each cout instruction,
> but it doesn't work .....
> 
> b) Does "long double pi= 3.14159265358979;"  exist with djgpp ?
> 
The member function .width(number) defines output field width not
precision. Use .precision(number) to define number of digits after the
decimal point.

Ralph

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019