delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/20/07:29:53

From: G DOT DegliEsposti AT ads DOT it
To: djgpp AT delorie DOT com
Message-ID: <C1256592.002E78CA.00@vega.ads.it>
Date: Tue, 20 Jan 1998 09:39:06 +0100
Subject: Re: 64 bit integers ??!?
Mime-Version: 1.0




>>It is indeed possible. Use long long int. You can try following code:
>>
>>main() {
>>   printf("%d\n", sizeof(long long int));
>>   }
>
>Strange, since an int is 32bit, I wonder 64bit integer are not declared at
>long int instead.

That's because the ANSI standard says explicitly that long int is 32 bit
long

>Also, is it possible to use shifting of more than 32bits. I.E. :
>mynum << 48;

yes it is.

I was wondering if gcc handles internally all integers as long long int,
making
instructions like this work:

(1 << b) >> 16 ==  1 << (b - 16)

with b > 16 TC++ gives unpredictable results because it can't upcast to
more than
32 bit long integer.

ciao
  Giacomo



- Raw text -


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