The type of an integer literal depends on three parameters: the value of the literal, whether it is written in decimal or not, and its suffix.
A literal with a single L
(or l
) will usually be of a (possibly unsigned
) long
type. But if its
value cannot be represented in this type, it will be of a (possibly unsigned
) long long
type instead.
In such a case, it is more straightforward to use LL
in the literal suffix, which unambiguously specifies a long long
type.
Note: This rule targets classical integer literals, not user-defined literals whose type is entirely determined by their suffix.