How many digits a Hex number can take is really defined by the size of the variable in bytes. Here I should mention that by digits I mean significant leading (not zeroes) digits, e.g.: 0xabcdef. Every HEX digit in bit representation takes up 4 bits, e.g.: F=1111, A=1010. So, having int variable of size 4 bytes or 32 bits, we divide 32 by 4 and get 8 significant HEX digits limit for int variable. In the same fashion, long is 8 bytes or 64 bits, divide it by 4 and get 16 significant HEX digits - your limit for long integer numbers in HEX. Try
and
you should get something like 7fffffffffffffff.