[M3devel] INTEGER

Jay K jay.krell at cornell.edu
Tue Apr 20 20:05:25 CEST 2010


 >  (To use Jay's expression, it's now 18 years later, and

 > many C environments still haven't caught up---int is still 32 bits in many of them!) 

 

Int is 32 bits in almost every C environment.

  Maybe some Cray has 64bit int.

  But every system I've seen has 32 bit (or 16 bit) int.

Do any C environments lack a 64bit "long" or "long long" or "__int64"?

 

 

I believe gcc is written to not depend on any 64bit integer or "long long" being guaranteed available, so it can compile with a compiler that only has up to "long", be it 32bits or 64bits.

I believe they represent 64bit integers internally as a pair of longs and always take 32bits from each. It is a little confusing but also makes sense. On systems with 64bit long, which there are many of, they waste space. It'd seem better to use a pair of 32bits ints or one 64bit long or long long. But it is portable, even if int is 16 bits.

 

 

 - Jay

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100420/7f62c70e/attachment-0002.html>


More information about the M3devel mailing list