Anonymous user
Bitwise operations: Difference between revisions
→{{header|REXX}}: moved the REXX entry to its proper place alphabetically. -- ~~~~
(→{{header|REXX}}: moved the REXX entry to its proper place alphabetically. -- ~~~~) |
|||
Line 1,780:
2over >> "a >> b = %d\n" puts
2drop ;</lang>
=={{header|REXX}}==▼
<lang rexx>/*Note that REXX stores all values (even numbers) as characters. */▼
a=21▼
b=347▼
Andy_Devine = bitand(a,b)▼
B.Orr = bitor(a,b)▼
xClueSieve = bitxor(a,b)▼
/*┌────────────────────────────────────────────────┐▼
│ these are all the bitwise operations that REXX │▼
│ allows natively. However, all other bitwise │▼
│ operations can be done easily with these three │▼
│ along with other built─in─functions (BIFs). │▼
└────────────────────────────────────────────────┘*/</lang>▼
=={{header|RLaB}}==
Line 1,799 ⟶ 1,814:
>> z = x / i2; printf("0x%08x\n",z); // right-shift is division by 2 where both arguments are integers
0x00000001</lang>
▲=={{header|REXX}}==
▲<lang rexx>/*Note that REXX stores all values (even numbers) as characters. */
▲a=21
▲b=347
▲ Andy_Devine = bitand(a,b)
▲ B.Orr = bitor(a,b)
▲ xClueSieve = bitxor(a,b)
▲ /*┌────────────────────────────────────────────────┐
▲ │ these are all the bitwise operations that REXX │
▲ │ allows natively. However, all other bitwise │
▲ │ operations can be done easily with these three │
▲ │ along with other built─in─functions (BIFs). │
▲ └────────────────────────────────────────────────┘*/</lang>
=={{header|Ruby}}==
|