RosettaCodeData/Task/Literals-Integer/NetRexx/literals-integer.netrexx

39 lines
2.9 KiB
Plaintext

/* NetRexx */
options replace format comments java crossref symbols
iv = 8; say '8'.right(20) '==' iv.right(8) -- 8
iv = -8; say '-8'.right(20) '==' iv.right(8) -- -8
iv = 1x8; say '1x8'.right(20) '==' iv.right(8) -- -8
iv = 2x8; say '2x8'.right(20) '==' iv.right(8) -- 8
iv = 2x08; say '2x08'.right(20) '==' iv.right(8) -- 8
iv = 0x08; say '0x08'.right(20) '==' iv.right(8) -- 8
iv = 0x10; say '0x10'.right(20) '==' iv.right(8) -- 16
iv = 0x81; say '0x81'.right(20) '==' iv.right(8) -- 129
iv = 2x81; say '2x81'.right(20) '==' iv.right(8) -- -127
iv = 3x81; say '3x81'.right(20) '==' iv.right(8) -- 129
iv = 4x81; say '4x81'.right(20) '==' iv.right(8) -- 129
iv = 04x81; say '04x81'.right(20) '==' iv.right(8) -- 129
iv = 16x81; say '16x81'.right(20) '==' iv.right(8) -- 129
iv = 4xF081; say '4xF081'.right(20) '==' iv.right(8) -- -3967
iv = 8xF081; say '8xF081'.right(20) '==' iv.right(8) -- 61569
iv = 0Xf081; say '0Xf081'.right(20) '==' iv.right(8) -- 61569
iv = 0xffff; say '0xffff'.right(20) '==' iv.right(8) -- 65535
iv = 4xffff; say '4xffff'.right(20) '==' iv.right(8) -- -1
iv = 8xffff; say '8xffff'.right(20) '==' iv.right(8) -- 65535
iv = 1b0; say '1b0'.right(20) '==' iv.right(8) -- 0
iv = 1b1; say '1b1'.right(20) '==' iv.right(8) -- -1
iv = 2b1; say '2b1'.right(20) '==' iv.right(8) -- 1
iv = 0b10; say '0b10'.right(20) '==' iv.right(8) -- 2
iv = 2b10; say '2b10'.right(20) '==' iv.right(8) -- -2
iv = 3b10; say '3b10'.right(20) '==' iv.right(8) -- 2
iv = 0b100; say '0b100'.right(20) '==' iv.right(8) -- 4
iv = 3b100; say '3b100'.right(20) '==' iv.right(8) -- -4
iv = 4b100; say '4b100'.right(20) '==' iv.right(8) -- 4
iv = 4b1000; say '4b1000'.right(20) '==' iv.right(8) -- -8
iv = 8B1000; say '8B1000'.right(20) '==' iv.right(8) -- 8
iv = 00B1111111111111111; say '00B1111111111111111'.right(20) '==' iv.right(8) -- 65535
iv = 16B1111111111111111; say '16B1111111111111111'.right(20) '==' iv.right(8) -- -1
iv = 32B1111111111111111; say '32B1111111111111111'.right(20) '==' iv.right(8) -- 65535
return