Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Integer-overflow/True-BASIC/integer-overflow.basic
Normal file
13
Task/Integer-overflow/True-BASIC/integer-overflow.basic
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
PRINT "Signed 32-bit:"
|
||||
PRINT -(-2147483647-1) !-2147483648
|
||||
PRINT 2000000000 + 2000000000 !4000000000
|
||||
PRINT -2147483647 - 2147483647 !-4294967294
|
||||
PRINT 46341 * 46341 !2147488281
|
||||
!PRINT (-2147483647-1) / -1 !error: Illegal expression
|
||||
WHEN ERROR IN
|
||||
PRINT maxnum * 2 !Run-time error "Overflow"
|
||||
USE
|
||||
PRINT maxnum
|
||||
!returns the largest number that can be represented in your computer
|
||||
END WHEN
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue