Bitwise operations: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: changes the demonstrative names to (my opinion) ''humorous'' versions.)
Line 235: Line 235:
PRINT "a SHR b (logical) = "; u SHR b
PRINT "a SHR b (logical) = "; u SHR b
END SUB</lang>
END SUB</lang>

=={{header|BASIC256}}==
<lang BASIC256># bitwise operators - floating point numbers will be cast to integer
a = 0b00010001
b = 0b11110000
print a
print int(a * 2) # right shift (multiply by 2)
print a \ 2 # left shift (integer divide by 2)
print a | b # bitwise or on two integer values
print a & b # bitwise or on two integer values</lang>


=={{header|Batch File}}==
=={{header|Batch File}}==