Posts

Showing posts with the label integer

32 bit Integer value vs 32 bit Hex value

32 bit Integer value vs 32 bit Hex value A 32-bit unsigned integer value can be from 0 to 2^32-1. That is, from 0 to  2147483647. Well, if somebody wants to remember the maximum value of integer they can remember it very easily because its a 10 digit number and so, pretend it as a phone number-  assuming youre in the US the value can be remembered as : 214-748-3647   Similarly,64-bit unsigned integer value can be from 0 to 2^64-1 . Now, 32-bit hex value can be from 0 to  0x7f f f f f f f There will be only 8 digits i.e.  7 f f f f f f f   because 1 digit corresponds to 4 bit. Hence 8 digits correspond to 8*4=32 bits. So, does that mean the digits which are followed by 0x are hexadecimal ... ? The answer is yes. Now, if you want to send 32-bit integer value on a network or want to use 32-bit integer value in a program how will you be sure that the value you are sending on a network or using in a program is 32-bit integer ? It all depends on the programming l...