delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/16/16:02:07

From: Mark Phillips <umphill5 AT cs DOT umanitoba DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: cout with double number
Date: Fri, 16 Jul 1999 14:26:27 -0500
Organization: The University of Manitoba
Lines: 36
Message-ID: <Pine.SUN.3.96.990716142443.9188A-100000@silver.cs.umanitoba.ca>
References: <7mo06p$gj2$1 AT wanadoo DOT fr>
NNTP-Posting-Host: silver.cs.umanitoba.ca
Mime-Version: 1.0
X-Trace: canopus.cc.umanitoba.ca 932153193 17033 130.179.24.6 (16 Jul 1999 19:26:33 GMT)
X-Complaints-To: Postmaster AT cc DOT umanitoba DOT ca
NNTP-Posting-Date: 16 Jul 1999 19:26:33 GMT
In-Reply-To: <7mo06p$gj2$1@wanadoo.fr>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

I think if you include iomanip.h and do

cout << setprecision(14) << pi;

It will achieve what you want.  Although I think there might be some other
stuff you need to do beforehand.  Try it out.

Mark


> 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 ?
> 
> Thanks for your answer.
> --
> -----------------------------------------------------------------
> Gil
> -----------------------------------------------------------------
> 
> 
> 

- Raw text -


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