delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/07/19/20:45:28

From: "Noel O'Donnell" <nodger AT eircom DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Doubles won't see double!!
Lines: 24
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
Message-ID: <KrkSa.23882$pK2.37447@news.indigo.ie>
Date: Sat, 19 Jul 2003 02:00:24 +0100
NNTP-Posting-Host: 159.134.113.37
X-Complaints-To: abuse AT eircom DOT net
X-Trace: news.indigo.ie 1058657130 159.134.113.37 (Sun, 20 Jul 2003 00:25:30 BST)
NNTP-Posting-Date: Sun, 20 Jul 2003 00:25:30 BST
Organization: Eircom.Net http://www.eircom.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello all,

Just wondering this:
How can I perform maths on doubles, so that the result uses the full
potential of a double's decimal spaces?

confused? ok, perhaps an example:

double x,y,z;
x=22;
y=7;
z=x/y;
cout<<z;

This will generally output something like:
3.1425(or whatever)
however if I do the same sum on the windoze calculator:
3.142857142957142857...................................you get the picture

so my question is this: How can I make MY doubles behave like this?
is there a library that i need to include? any suggestions?



- Raw text -


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