On 04/16/10 16:50, Ark wrote: > Hi everyone. > A friend of mine suggested me to do the next experiment in python and Java. > > It's a simple program to sum all the numbers from 0 to 1000000000. > > result = i = 0 > while i < 1000000000: > result += i > i += 1 > print result >
Are you sure you're not causing Java to overflow here? In Java, Arithmetic Overflow do not cause an Exception, your int will simply wrap to the negative side. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor