2016-12-03 | Paul Boddie | raw annotate files changeset graph | Removed incomplete or superfluous library modules used for previous work. |
1 i = 2 ** 30 2 print i # 1073741824 3 4 j = -2 ** 30 5 print j # -1073741824 6 7 print i + j # 0 8 9 try: 10 print i - j 11 except OverflowError: 12 print "i - j: overflow occurred" 13 14 print i / i # 1 15 print i / j # -1 16 print j / j # 1 17 print j / i # -1 18 19 try: 20 print i * j 21 except OverflowError: 22 print "i * j: overflow occurred" 23 24 print i - i # 0 25 print j - j # 0 26 print ~j # 1073741823 27 print i & ~j # 0 28 print i - 1 & ~j # 1073741823