From: your AT name DOT here (Kirk Hobart) Newsgroups: comp.os.msdos.djgpp Subject: Re: LARGE numbers. Date: Thu, 27 Aug 1998 09:36:34 GMT Organization: Airnews.net! at Internet America Lines: 29 Message-ID: References: <1103_904198596 AT isaacc> Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: librarytest.airnews.net NNTP-Posting-Time: Thu Aug 27 04:36:37 1998 NNTP-Posting-Host: cUZ2!+CQrX1GLmH0d%T0Be1BFCh,,>Bl.F%+TMKB (Encoded at Airnews!) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk isaacc AT flash DOT net wrote: >I want to store the following number (25834242042) as an int, I declare it as usual: > >int var = 258342042; > >yet the number is obviouslu too large to store as an integer (even an unsigned one). >Subsequently I try to store it as both 'float' and 'double' - yet they wont even hold a number of >this size! #include int main(void) { double a = 25834242042.0; float b = 25834242042.0; long long c = 25834242042; printf(" double: %.1f\n", a); printf(" float: %.1f\n", b); printf("long long: %Ld\n", c); return 0; } Compile with djgpp and run... double: 25834242042.0 float: 25834242048.0 long long: 25834242042 Notice the round-off error in the float.