13
Feb
It-s-over-9000-its-over-9000-29849302-496-370

If you're idly cruising the Play Store on the web, checking out the most downloaded apps ever, you might stumble onto a little glitch when an install count crosses 1 billion. That's right, billion... We're talking 9 zeros, folks! Hitting this illustrious mark will result in an install range that reads 1,000,000,000 - 705,032,704. Not only does tradition tell us that the larger number should come second, but that is an exceptionally specific amount.

Screen Shot 2014-02-13 at 3.14.51 AM

The bug is actually the result of an integer overflow. I probably just lost most of the non-programmers out there, but this one is pretty simple. If you know and understand binary, feel free to skip the next paragraph.

For non-programmers: All computer data is stored as bits, represented as 1 or 0. Using a numbering system called Binary, we can interpret groups of bits as larger numbers. The computer world has a standard convention of grouping 8 bits together to form a byte. From there, the sizes tend to double as needed. A particularly common size for storing an integer (number without a decimal point) is 32 bits, or 4 bytes. It's this common size that holds the key to this error.

Unfortunately, the highest number that can be represented by an unsigned 32-bit integer is 4,294,967,295. To reach 5 billion requires a 33rd bit. The value may be stored in a larger space on Google's servers, but it is eventually treated as a 32-bit integer, which chops off the leading bit. As you might be able to guess, the result is 705,032,704. Here is what the numbers look like in binary.

bits

Note: These binary sequences are treated as unsigned integers

Google Play Services is almost certainly the first and only app to join the Billion Installs Club, so far. Even GMail and Facebook are still locked into the 500 million - 1 billion range. Thanks to the Internet Archive Wayback Machine, we can further deduce that the install count only hit 10 digits about 3 weeks ago, somewhere between the 24th and 31st of January.

On the plus side, this doesn't matter at all. Everything else is working fine, we just have the wrong number for something that doesn't matter very much. It's just a little something to chuckle at on this Thursday. Hey, who said a Bug Watch had to be totally serious?

Oh yeah, and let's just wrap this up with something from xkcd.

1_to_10

Image Credit:xkcd

Thanks, Neznani Oboževalec

Cody Toombs
Cody is a Software Engineer and Writer with a mildly overwhelming obsession with smartphones and the mobile world. If he’s been pulled away from the computer for any length of time, you might find him talking about cocktails and movies, sometimes resulting in the consumption of both.

  • http://AppsZoom.com/ Peter Warrior

    Nine zeroes? Are those billions of yours bought in a second-hand shop?
    (just joking. European humour)

  • Darrien Glasser

    Hey Google, why the long face?

    *Badum tish.*

    http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html

  • GraveUypo

    for non-programmers it would be easier to say the software registering that can't count that high.

    • WORPspeed

      But...but...it's a computer...it can count to infinity and back right?

      :P

    • Wesley Modderkolk

      But that would be wrong. Because it isn't really a fault in the software, it just is a physical limit in what can be done with a 32-bit address.

      • Scott Kaforey

        How is it not a fault in the software? They obviously didn't expect or program for that many installs. It is a bug. Rule #1 of programming, expect the unexpected

        • Kostas

          This is definetely not rule #1 :P

      • http://www.androidpolice.com/author/cody-toombs/ Cody Toombs

        I've got no evidence, but I would almost bet that the bug is happening at the point where the number is being printed on the page. The method used for converting and formatting the number as easily readable text (i.e. commas every 3 digits) probably expects a 32-bit int. That's fairly common in the convenience methods for a lot of languages.

    • Rob

      but that would be wrong in every sense. It CAN count higher, up to 4,294,967,295. It is a conversion error, not a upper limit of countable numbers...

  • PhineasJW

    They should have used a long. :)

  • Tony

    Came here just for Vegeta! Well done sir.