Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Integer-overflow/Visual-Basic/integer-overflow-1.vb
Normal file
12
Task/Integer-overflow/Visual-Basic/integer-overflow-1.vb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
'Binary Integer overflow - vb6 - 28/02/2017
|
||||
Dim i As Long '32-bit signed integer
|
||||
i = -(-2147483647 - 1) '=-2147483648 ?! bug
|
||||
i = -Int(-2147483647 - 1) '=-2147483648 ?! bug
|
||||
i = 0 - (-2147483647 - 1) 'Run-time error '6' : Overflow
|
||||
i = -2147483647: i = -(i - 1) 'Run-time error '6' : Overflow
|
||||
i = -(-2147483647 - 2) 'Run-time error '6' : Overflow
|
||||
i = 2147483647 + 1 'Run-time error '6' : Overflow
|
||||
i = 2000000000 + 2000000000 'Run-time error '6' : Overflow
|
||||
i = -2147483647 - 2147483647 'Run-time error '6' : Overflow
|
||||
i = 46341 * 46341 'Run-time error '6' : Overflow
|
||||
i = (-2147483647 - 1) / -1 'Run-time error '6' : Overflow
|
||||
4
Task/Integer-overflow/Visual-Basic/integer-overflow-2.vb
Normal file
4
Task/Integer-overflow/Visual-Basic/integer-overflow-2.vb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
i=0
|
||||
On Error Resume Next
|
||||
i = 2147483647 + 1
|
||||
Debug.Print i 'i=0
|
||||
6
Task/Integer-overflow/Visual-Basic/integer-overflow-3.vb
Normal file
6
Task/Integer-overflow/Visual-Basic/integer-overflow-3.vb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
i=0
|
||||
On Error GoTo overflow
|
||||
i = 2147483647 + 1
|
||||
...
|
||||
overflow:
|
||||
Debug.Print "Error: " & Err.Description '-> Error: Overflow
|
||||
3
Task/Integer-overflow/Visual-Basic/integer-overflow-4.vb
Normal file
3
Task/Integer-overflow/Visual-Basic/integer-overflow-4.vb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
On Error GoTo 0
|
||||
i = 2147483647 + 1 'Run-time error '6' : Overflow
|
||||
Debug.Print i
|
||||
Loading…
Add table
Add a link
Reference in a new issue