Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
4 Variables and Types<br />
Literal integer constants can be expressed in decimal (base 10), octal (base 8), or hexadecimal (base 16)<br />
as follows.<br />
integer-constant :<br />
decimal-constant integer-suffix opt<br />
octal-constant integer-suffix opt<br />
hexadecimal-constant integer-suffix opt<br />
integer-suffix: one of<br />
u U<br />
decimal-constant :<br />
nonzero-digit<br />
decimal-constant digit<br />
octal-constant :<br />
0<br />
octal-constant octal-digit<br />
hexadecimal-constant :<br />
0x hexadecimal-digit<br />
0X hexadecimal-digit<br />
hexadecimal-constant hexadecimal-digit<br />
digit :<br />
0<br />
nonzero-digit<br />
nonzero-digit : one of<br />
1 2 3 4 5 6 7 8 9<br />
octal-digit : one of<br />
0 1 2 3 4 5 6 7<br />
hexadecimal-digit : one of<br />
0 1 2 3 4 5 6 7 8 9<br />
a b c d e f<br />
A B C D E F<br />
No white space is allowed between the digits of an integer constant, including after the leading 0 or after<br />
the leading 0x or 0X of a constant, or before the suffix u or U. When the suffix u or U is present, the<br />
literal has type uint, otherwise the type is int. A leading unary minus sign (-) is interpreted as an<br />
arithmetic unary negation, not as part of the constant.<br />
It is an error to provide a literal integer whose magnitude is too large to store in a variable of matching<br />
signed or unsigned type.<br />
19