RosettaCodeData/Task/Bitwise-operations/CoffeeScript/bitwise-operations-1.coffee

13 lines
199 B
CoffeeScript
Raw Permalink Normal View History

2013-04-10 16:19:29 -07:00
f = (a, b) ->
p "and", a & b
p "or", a | b
p "xor", a ^ b
p "not", ~a
p "<<", a << b
p ">>", a >> b
# no rotation shifts that I know of
p = (label, n) -> console.log label, n
f(10,2)