[Solved] The video sharing site YouTube originally stored the number – Computer Science

The best explanation for what happened with YouTube’s view count for “Gangnam Style” is:

Answer: (Choice B) Integer overflow error

Explanation:

An integer overflow error occurs when an arithmetic operation attempts to create a numeric value that is outside of the range that can be represented with a given number of bits, either larger than the maximum or lower than the minimum representable value.

In the case of YouTube, they were using a 32-bit signed integer to store the number of video views. A 32-bit signed integer can represent values from -2,147,483,648 to 2,147,483,647. When “Gangnam Style” received more than 2,147,483,647 views, it exceeded the maximum value that could be stored in a 32-bit signed integer, causing an integer overflow error.

This is not related to the use of integers instead of floating-point numbers (Choice A), as the number of views should be an integer value. It is also not a round-off error in floating-point arithmetic (Choice C) or a limitation in the precision of floating-point numbers (Choice D), as these issues are related to the representation of fractional numbers, not integers.

Read more here: Source link