How big is a 64-bit integer? Can Gangam style overflow it?

9Gag is flushed with memes about what possibly can break the internet, but PSY has done almost that. PSY’s catchy, though irritating, number Gangnam style has crossed 2 billion views mark on 1st December 2014. These many views were unprecedented when Youtube was coded, which handled views count in a signed 32-bit integer. A signed 32-bit integer can have a maximum value of 2,147,483,647, a.k.a INT_MAX to C programmers. For non-programmers, incrementing INT_MAX by another number will force a roll over to -2,147,483,647, which many observed on Youtube.

As a fix, Youtube has upgraded the view counter handler to a 64-bit signed integer. A signed 64-bit integer has a max of 9,223,372,036,854,775,807, which in words will be “nine quintillion two hundred twenty-three quadrillion three hundred seventy-two trillion thirty-six billion eight hundred fifty-four million seven hundred seventy-five thousand eight hundred seven”. So how really big this number is? Is it big enough to handle the number of fans of Gangnam style? Or in simpler words, how many years will be required to break the internet again?

Lets try to do some simple math to understand the enormity of the number. If a video is watched by a million people every second, then it will take approx 293 years to reach the limit (assuming no leap year is there), which probably means never. So PSY has a hell of task ahead of him, while 9Gagers can look out for other causes as this one is unlikely to happen.

(9223372036854775807 / 1,000,000 * 60 * 60 * 24 * 365) = 292.471208677536

If this got you interested, then also checkout the Year 2038 Problem.