I've encountered a website that uses a 50-digit decimal integer ID in a URL query string, which seems a little excessive.
The smallest 50-digit decimal number is 1.0 x 10^49
, otherwise known as:
1000000000
0000000000
0000000000
0000000000
0000000000
- How many bits would the binary representation contain?
- How would you approach converting such a large decimal number to binary, taking into consideration the range limit of unsigned 32-bit-integer or 64-bit integers?
I ask out of pure programmer curiosity only - this is not a college question, work problem or interview puzzle!