There is no general style guide that I found. I use capital letters and I'm picky about using F for floating literals and L for a long double. I also use appropriate suffixes for integral literals.
I assume that you know what these suffixes mean: 3.14F is a float literal, 12.345 is a double literal, 6.6666L is a long double literal.
For integers: U is unsigned , L is long , LL is long long . The order between U and L does not matter, but I always set UL , because I declare such variables as unsigned long for example.
If you assign a literal of one type to a literal of another type or specify a numeric literal of one type for an argument to a function of another type, an act must occur. Using the proper suffix avoids this and is useful on the same lines as static_cast, useful for calling throws. Consistent use of numeric letter suffixes is a good style and avoids numeric surprises.
People differ in whether lower or upper case is better. Choose a style that looks good to you and is consistent.
emsr
source share