36

There has been a story in the news about a man whose Paypal account was accidentally credited with $92,233,720,368,547,800.

Where does this number come from? What sort of programming bug is likely to give rise to this number?

closed as off-topic by user22815, durron597, enderland, GlenH7, ratchet freak Jul 18 '15 at 0:06

  • This question does not appear to be about software engineering within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 5
    I'm voting to close this question as off-topic because it is not a conceptual programming problem within the scope defined in the help center. – user22815 Jul 13 '15 at 15:22
58

It's the maximum value of a long (64 bit signed integral type).

from http://msdn.microsoft.com/en-us/library/system.int64.maxvalue.aspx

The value of this constant is 9,223,372,036,854,775,807; that is, hexadecimal 0x7FFFFFFFFFFFFFFF.

This would be the maximum value for a 64-bit signed integral type in any language, I'm not assuming paypal uses .NET, the link to MSDN above is just illustrative.

The error is likely just a poor conversion error (like from decimal or float or etc to long that didn't work correctly) resulting in some overflowing of a value, or bad defaulting code for some strange scenario, or it could have been a test in production by their engineering/QA team gone hay-wire. Memory leak/pointer error, the list of ways to cause this are really countless. Could have been a parsing error deserializing some information that came to them across the wire, tremendously numerous ways to accidentally end up with an unexpected or misaligned integral value.

  • 1
    even more odd is that the number was apparently rounded up to the nearest $100 dollars. – KutuluMike Jul 19 '13 at 20:16
  • 4
    Why are the numbers in the question and answer not the same? – thursdaysgeek Jul 19 '13 at 22:46
  • 3
    Because the integer value is a count of pennies. So you divide 2^63-1 by 100 to get dollars. And then something rounded to the nearest $100 for some reason. – Mark Adler Jul 20 '13 at 0:06
  • 4
    @thursdaysgeek some math went wrong enough to cause an integral overflow, chances are in the process of the code getting math wrong it continued calculating some operations after the overflow occurred causing the amount to change even more. As if the equation was 2+3*4*8/22+400^2 and on the second step an overflow occurs, the folowing operations will continue applying to that incorrect number. – Jimmy Hoffa Jul 20 '13 at 0:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.