long long long long integers 
Author Message
 long long long long integers

Quote:

>possibilities.  I had the impression that type 'int'
>was the word size of a machine.  

Wrong impression.  The only restriction on type int is that it has at
least 16 bits.  Hence it _cannot_ have the word size on a machine with
a word smaller than 16 bits (8-bit micros are such examples).

Quote:
>Shouldn't a 64 bit
>int on a 64 bit machine be, well, an 'int'?

Not a particularly brilliant idea.  If the machine supports 8, 16, 32 and
64-bit integer types and int is 64 bits, you're left with only two
shorter types, char and short, for three sizes: 8, 16 and 32 bits, while
int and long are used for the same size: 64 bits.

DEC had a better idea when they introduced their 64-bit machine: they
made int 32 bits and long 64 bits.  This allowed them to have 8-bit
char's and 16-bit short's.  No need to invent non-standard types when
you can get the job done using only standard types.

Dan
--
Dan Pop
CERN, CN Division

Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland



Sun, 12 Apr 1998 03:00:00 GMT  
 long long long long integers
     Let's see if I've got this straight.  In order to avoid breaking code
that made unwarranted assumptions about sizes of integer data types, some
manufacturers are going to break the standard instead.  Kind of
ass-backward, don't you think?

     Mr. Summit, I hope you are pushing AGAINST this.  [tongue in cheek on]
"We have your FAQ credibility.  If you don't follow instructions, pffft!"
[tongue in cheek off]  The same goes for anyone who argues in favor of
using the standard.  C is a nice, small language and I'd like to see it
stay that way.

Sincerely,

Gene Wirchenko

void main(): blechfast of chumps

--

"'Bugs, Mr. Rico!  Zillions of 'em! ...'"
-Robert A. Heinlein, "Starship Troopers"



Sun, 12 Apr 1998 03:00:00 GMT  
 long long long long integers

Quote:

>   In the faq it was asked what 64 bit integreal values on
> 64 bit machines should be called and the response
> was that 'long long int' or 'huge int' were debatable
> possibilities.  I had the impression that type 'int'
> was the word size of a machine.  Shouldn't a 64 bit
> int on a 64 bit machine be, well, an 'int'?

That's indeed another possibility, and the posted version of the
FAQ list should probably mention it (except that it's far too
long at the moment).  The "even longer" version (coming real soon
to a bookstore near you) already does, viz.:

1.4:    What should the 64-bit type on new, 64-bit machines be?

A:      This is a sticky question.  There are at least three ways of
        looking at it:

        1.      On existing 16- and 32-bit systems, two of the three
                integer types (short and plain int, or plain int and
                long) are typically the same size.  On a 64-bit machine,
                there is finally the opportunity to make all three types
                three different sizes.  Therefore, some vendors support
                64-bit long ints.

        2.      Sadly, a lot of existing code is written to assume that
                ints and longs are the same size, or that one or the
                other of them is exactly 32 bits.  Rather than risk
                breaking such code, some vendors introduce a new,
                nonstandard, 64-bit long long (or __longlong, or
                __very long) type instead.

        3.      Finally, it can be argued that plain int should be 64
                bits on a 64-bit machine, since int traditionally
                reflects "the machine's natural word size."

        Programmers interested in writing portable code should therefore
        insulate any use of a 64-bit type behind an appropriate typedef
        (and will also have to provide 64-bit support manually when
        porting such code to 16- or 32-bit environments.)  Vendors who
        feel compelled to introduce a new, longer integral type should
        advertise it as being "at least 64 bits" (which is truly new, a
        type traditional C does not have), and not "exactly 64 bits."

        References: ANSI Sec. F.5.6
        ISO Sec. G.5.6

                                                Steve Summit



Sun, 12 Apr 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. char size (was long long long long long int)

2. short/long/long long Formatting questions

3. Long long and long double

4. long long integer and double precision number

5. Integer data types - long long???

6. 64 bit long long integers

7. standardization of longer-than-long integers?

8. REPOST: Re: Neo Longest ThrREPOST: Re: Neo Longest ThrREPOST: Re: Neo Longest ThrREPOST: Re: Neo Longest Thread Ever II

9. REPOST: Re: Neo Longest ThrREPOST: Re: Neo Longest ThrREPOST: Re: Neo Longest ThrREPOST: Re: Neo Longest Thread Ever II

10. Long long :)

11. Availability of long long?

12. long long support VC/VC++ .NET?

 

 
Powered by phpBB® Forum Software