File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55# result needs rounding up
66print (- (1 << 70 ) >> 80 )
7+ print (- 0xffffffffffffffff >> 32 )
Original file line number Diff line number Diff line change 1919print ((- a ) ^ (1 << 200 ))
2020print ((- a ) ^ a == 0 )
2121print (bool ((- a ) ^ a ))
22+ print (- 1 ^ 0xffffffffffffffff ) # carry overflows to higher digit
2223
2324# test + -
2425
Original file line number Diff line number Diff line change 77# printing
88print (x )
99print (y )
10+ print ('%#X' % (x - x )) # print prefix
11+ print ('{:#,}' .format (x )) # print with commas
1012
1113# addition
1214print (x + 1 )
6769print (int ("123456789012345678901234567890abcdef" , 16 ))
6870print (int ("123456789012345678901234567890ABCDEF" , 16 ))
6971
72+ # invalid characters in string
73+ try :
74+ print (int ("123456789012345678901234567890abcdef" ))
75+ except ValueError :
76+ print ('ValueError' );
77+
7078# test constant integer with more than 255 chars
7179x = 0x84ce72aa8699df436059f052ac51b6398d2511e49631bcb7e71f89c499b9ee425dfbc13a5f6d408471b054f2655617cbbaf7937b7c80cd8865cf02c8487d30d2b0fbd8b2c4e102e16d828374bbc47b93852f212d5043c3ea720f086178ff798cc4f63f787b9c2e419efa033e7644ea7936f54462dc21a6c4580725f7f0e7d1aaaaaaa
7280print (x )
You can’t perform that action at this time.
0 commit comments