Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Integer-overflow/Python/integer-overflow-1.py
Normal file
18
Task/Integer-overflow/Python/integer-overflow-1.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
|
||||
Type "copyright", "credits" or "license()" for more information.
|
||||
>>> for calc in ''' -(-2147483647-1)
|
||||
2000000000 + 2000000000
|
||||
-2147483647 - 2147483647
|
||||
46341 * 46341
|
||||
(-2147483647-1) / -1'''.split('\n'):
|
||||
ans = eval(calc)
|
||||
print('Expression: %r evaluates to %s of type %s'
|
||||
% (calc.strip(), ans, type(ans)))
|
||||
|
||||
|
||||
Expression: '-(-2147483647-1)' evaluates to 2147483648 of type <type 'long'>
|
||||
Expression: '2000000000 + 2000000000' evaluates to 4000000000 of type <type 'long'>
|
||||
Expression: '-2147483647 - 2147483647' evaluates to -4294967294 of type <type 'long'>
|
||||
Expression: '46341 * 46341' evaluates to 2147488281 of type <type 'long'>
|
||||
Expression: '(-2147483647-1) / -1' evaluates to 2147483648 of type <type 'long'>
|
||||
>>>
|
||||
18
Task/Integer-overflow/Python/integer-overflow-2.py
Normal file
18
Task/Integer-overflow/Python/integer-overflow-2.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)] on win32
|
||||
Type "copyright", "credits" or "license()" for more information.
|
||||
>>> for calc in ''' -(-2147483647-1)
|
||||
2000000000 + 2000000000
|
||||
-2147483647 - 2147483647
|
||||
46341 * 46341
|
||||
(-2147483647-1) / -1'''.split('\n'):
|
||||
ans = eval(calc)
|
||||
print('Expression: %r evaluates to %s of type %s'
|
||||
% (calc.strip(), ans, type(ans)))
|
||||
|
||||
|
||||
Expression: '-(-2147483647-1)' evaluates to 2147483648 of type <class 'int'>
|
||||
Expression: '2000000000 + 2000000000' evaluates to 4000000000 of type <class 'int'>
|
||||
Expression: '-2147483647 - 2147483647' evaluates to -4294967294 of type <class 'int'>
|
||||
Expression: '46341 * 46341' evaluates to 2147488281 of type <class 'int'>
|
||||
Expression: '(-2147483647-1) / -1' evaluates to 2147483648.0 of type <class 'float'>
|
||||
>>>
|
||||
Loading…
Add table
Add a link
Reference in a new issue