Article View: comp.std.c
Article #3796Re: Why "long long" doesn't work.
From: FFarance
Date: Sun, 20 Aug 1995 07:41
Date: Sun, 20 Aug 1995 07:41
57 lines
3090 bytes
3090 bytes
> From: aeb@cwi.nl (Andries Brouwer) > Lines: 24 > > ffarance@aol.com (FFarance) writes: > > :: From: thads@csn.net (Thad Smith) > :: > :: The primary point of integers is to count. > :: When do you need to count beyond 2 to the 40th? 2 to the 64th? > :: > :: Other conceivable uses are for high-resolution fixed point arithmetic > :: (why not use floating point?), structures holding several fields (why > :: not declare these as actual structures?) and number theory, as used in > :: RSA computing (you need more precision anyway for this application). > > : The use of large integers doesn't mean we need to count that high. If > : that were the case, mathematics would be confined to small numbers. A > : couple every day examples from computing would be a 64-bit timestamp > : (high order is number of seconds, low order is fractions down to about > : 250 picoseconds) or a 64-bit fat pointer (high order is IP address, low > : order is local memory address). > > So what you are saying here, is that Thad is right - your examples > are structures with several fields (and still only need 64 bits). No. You'd probably also conclude that any number could be treated as a series of 8-bit bytes and stored as several fields in a structure. While anything can be decomposed, there is utility in having a complete integer. In the timestamp example, I'd expect to do arithmetic on the *complete number*, not each part separately. Similarly, with the fat pointer I expect to perform arithmetic on it as a 64-bit number -- you wouldn't represent a ``far'' pointer as a structure because you'd treat it as a single entity. > There is no good reason to consider integer types that are required > to have more than 64 bits. Meanwhile, there are still applications in mathematics, handwriting systems, and databases for more than 64 bits. Floating point isn't as convenient (different semantics, lower performance) than fixed pointer arithmetic for certain applications. What applications? Picture any program you've written that uses integer types. Now change the declarations so floating types are used. Does the program behave the same (i.e., same functionality) and have the same performance? If not, you've got an example of an application where fixed point is more convenient than floating point. -FF ------------------------------------------------------------------- (``I only use AOL for reading netnews.'') Frank Farance, Farance Inc. E-mail: frank@farance.com, Telephone: +1 212 486 4700 ISO JTC1/SC22/WG14 & ANSI X3J11 (C Programming Language) Project Editor
Technical Details
Message-ID:
<416ouv$ekq@newsbf02.news.aol.com>Path:
arc1-ca.pugleaf.net!newsbf02.news.aol.com!not-for-mailReferences:
<aeb.808886342@news.cwi.nl>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!newsbf02.news.aol.com!not-for-mail From: ffarance@aol.com (FFarance) Newsgroups: comp.std.c Subject: Re: Why "long long" doesn't work. Date: 20 Aug 1995 03:41:19 -0400 Organization: America Online, Inc. (1-800-827-6364) Sender: root@newsbf02.news.aol.com Message-ID: <416ouv$ekq@newsbf02.news.aol.com> References: <aeb.808886342@news.cwi.nl> Reply-To: ffarance@aol.com (FFarance) NNTP-Posting-Host: newsbf02.mail.aol.com