70.5k views
5 votes
A video-streaming website uses 32-bit integers to count the number of times eachvideo has been played. In anticipation of some videos being played more times thancan be represented with 32 bits, the website isplanning to change to 64-bitintegers for the counter. How many more values can be represented as a result ofusing 64-bit integers instead of 32-bit integers?

User Jwchoi
by
3.6k points

1 Answer

6 votes

Answer:

2³² times more values can be stored as a result of using 64-bit integers.

Step-by-step explanation:

A video-streaming website uses 32-bit integers to count the number of times each video has been played which means that it can store 2³² different values

2³² = 4,294,967,296 bits (unsigned)

If the video-streaming website decides to use 64-bit integers to count the number of times each video has been played then it can store

2⁶⁴ = 2³²*2³²

Therefore, 2³² times more values can stored if they shift to 64-bit integers.

2⁶⁴ = 4,294,967,296*4,294,967,296

2⁶⁴ = 18,444,644,073,709,551,616 (unsigned)

User Zvika
by
4.2k points