I've run across some code like this:
line += addr & 0x3fULL;
Obviously, 'U' and 'L' are not hex digits. I'm guessing that the 'ULL' at the end of that hex numeric literal means "Unsigned Long Long" - am I correct? (this sort of thing is very difficult to google) if so then this is some sort of suffix modifier on the number?
unsigned long int: character ul or UL at the end of integer constant. long long int: character ll or LL at the end of integer constant. unsigned long long int: character ull or ULL at the end of integer constant.
They can be represented as: Decimal integer literals. Hexadecimal integer literals. Octal integer literals.
It is extremely easy to inadvertently create an integer object with the wrong value, because '013' means 'decimal 11', not 'decimal 13', to the Python language itself, which is not the meaning that most humans would assign to this literal.
From the gcc
manual:
ISO C99 supports data types for integers that are at least 64 bits wide ( . . . ) . To make an integer constant of type
long long int
, add the suffixLL
to the integer. To make an integer constant of typeunsigned long long int
, add the suffixULL
to the integer.
These suffixes have also been added to C++ in C++11, and were already supported long long (pun intended) before that as compiler extensions.
Yes that's correct.
0x
prefix makes it a hexadecimal literal.ULL
suffix makes it type unsigned long long
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With