Bitwise operations: Difference between revisions

Added S-BASIC example
(→‎{{header|11l}}: `(-)` -> `~`)
imported>KayproKid
(Added S-BASIC example)
Line 5,658:
put _all_;
run;</syntaxhighlight>
 
=={{header|S-BASIC}}==
S-BASIC does not have bitwise shift or rotate operators. The test values are taken from the 11l example.
<syntaxhighlight lang="BASIC"
var a, b = integer
a = 10
b = 2
print "a ="; a; tab(16); hex$(a)
print "b ="; b; tab(16); hex$(b)
print "a and b ="; a and b; tab(16); hex$(a and b)
print "a or b ="; a or b; tab(16); hex$(a or b)
print "a xor b ="; a xor b; tab(16); hex$(a xor b)
print "not a ="; not a; tab(16); hex$(not a)
 
end
</syntaxhighlight>
{{out}}
<pre>
a = 10 000A
b = 2 0002
a and b = 2 0002
a or b = 10 000A
a xor b = 688 02CD
not a =-11 FFF5
</pre>
 
=={{header|Scala}}==
 
Anonymous user