Bitwise operations: Difference between revisions

Line 976:
 
=={{header|Elena}}==
<lang elena>#import systemextensions.
#import extensions.
 
#class(extension) testOp
{
#method bitwiseTest : y
[
console writeLine:self:" and ":y:" = ":(self and:y).
Line 987 ⟶ 986:
console writeLine:self:" xor ":y:" = ":(self xor:y).
console writeLine:"not ":self:" = ":(self inverted).
console writeLine:self:" shr ":y:" = ":(self shift &index:y).
console writeLine:self:" shl ":y:" = ":(self shift &index:(y negative)).
]
}
 
#symbol program =
[
console readLine:(Integer new) bitwiseTest:(console readLine:(Integer new)).
Anonymous user