What do 0LL or 0x0UL mean?

前端 未结 5 1110
离开以前
离开以前 2020-12-04 21:57

I am reading the Google Go tutorial and saw this in the constants section:

There are no constants like 0LL or 0x0UL

I tried to d

5条回答
  •  渐次进展
    2020-12-04 22:40

    LL designates a literal as a long long and UL designates one as unsigned long and 0x0 is hexadecimal for 0. So 0LL and 0x0UL are an equivalent number but different datatypes; the former is a long long and the latter is an unsigned long.

    There are many of these specifiers:

    1F // float
    1L // long
    1ull // unsigned long long
    1.0 // double
    

提交回复
热议问题