Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
24
Task/Twos-complement/XBasic/twos-complement.basic
Normal file
24
Task/Twos-complement/XBasic/twos-complement.basic
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
PROGRAM "Two's complement"
|
||||
VERSION "0.0000"
|
||||
|
||||
DECLARE FUNCTION Entry ()
|
||||
|
||||
FUNCTION Entry ()
|
||||
d = 1234567
|
||||
|
||||
DIM b[8]
|
||||
b[0] = -d
|
||||
b[1] = -d+1
|
||||
b[2] = -2
|
||||
b[3] = -1
|
||||
b[4] = 0
|
||||
b[5] = 1
|
||||
b[6] = 2
|
||||
b[7] = d-2
|
||||
b[8] = d-1
|
||||
|
||||
FOR i = 0 TO UBOUND(b[])
|
||||
PRINT b[i]; " -> "; -b[i]
|
||||
NEXT i
|
||||
END FUNCTION
|
||||
END PROGRAM
|
||||
Loading…
Add table
Add a link
Reference in a new issue