Unexpected results when working with very big integers on interpreted languages
Python works: >>> sum(x for x in xrange(1000000000 + 1)) 500000000500000000 Or: >>> sum(xrange(1000000000+1)) 500000000500000000 Python’s int auto promotes to a Python long which supports arbitrary precision. It will produce the correct answer on 32 or 64 bit platforms. This can be seen by raising 2 to a power far greater than the bit width … Read more