Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does GCC support long long int?

Tags:

c++

c

gcc

Does GCC support:

long long int

which would be a 64-bit integer?

Also, is long long int part of the standard?

like image 659
Polaris878 Avatar asked Oct 06 '09 03:10

Polaris878


3 Answers

Yes GCC does support long long int, which is a part of C99 standard.

The standard does not mandate its size in bits, but required values of LLONG_MIN and LLONG_MAX in <limits.h> imply it's at least 64-bit (exact 64-bit wide integer types are int64_t/uint64_t from <stdint.h>).

  1. LLONG_MIN must be at most -9223372036854775807
  2. LLONG_MAX must be at least 9223372036854775807
like image 137
Alex B Avatar answered Oct 05 '22 18:10

Alex B


long long int is a part of the C99 standard, and I know GCC supports it. And now I can prove it.

like image 34
Chris Lutz Avatar answered Oct 05 '22 17:10

Chris Lutz


On my 32-bit machine,

int main()
{
    printf("%d\n", sizeof(long long int));
    return 0;
}

compiled with gcc prints 8 (8 bytes * 8 bits/byte = 64 bits).

like image 28
Mark Rushakoff Avatar answered Oct 05 '22 16:10

Mark Rushakoff