Does GCC support long long int?

前端 未结 7 2107
南方客
南方客 2020-12-31 07:08

Does GCC support:

long long int

which would be a 64-bit integer?

Also, is long long int part of the standard?

相关标签:
7条回答
  • 2020-12-31 07:31

    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
    0 讨论(0)
  • 2020-12-31 07:32

    long longs are well supported, and have been for a long long time [sorry]. As I understand it, this should have been 128 bit on 64-bit platforms, but for compatibility/portability reasons in GCC, has standardised on a 64-bit width.

    See also: (u)int128_t, and this discussion on GCC's 128-bit integer support

    0 讨论(0)
  • 2020-12-31 07:33

    Yes, long long is part of C99, as well as long long constants (10222333444555LL) and a few support elements. (LLONG_MAX, llrint(d), llround(d), some others.) And gcc has implemented it for some time now.

    0 讨论(0)
  • 2020-12-31 07:34

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

    0 讨论(0)
  • 2020-12-31 07:34

    In order to print long long int variables:

    long long int lli = 100000000;
    
    printf("%lld\n", lli);
    
    0 讨论(0)
  • 2020-12-31 07:36

    I believe that usually an unsigned long long is the traditional representation of a 64-bit integer. I'm assuming long long int would work too, but I've never personally seen any 64-bit vars declared that way before.

    0 讨论(0)
提交回复
热议问题