nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: intro `prompt`, basic Apache 2.0 service to display a prompt
[nit.git]
/
examples
/
rosettacode
/
bitwise_operations.nit
diff --git
a/examples/rosettacode/bitwise_operations.nit
b/examples/rosettacode/bitwise_operations.nit
index
c24ee4e
..
d543ad5
100644
(file)
--- a/
examples/rosettacode/bitwise_operations.nit
+++ b/
examples/rosettacode/bitwise_operations.nit
@@
-5,15
+5,14
@@
# Task: Bitwise operations
# SEE: <http://rosettacode.org/wiki/Bitwise_operations>
# Task: Bitwise operations
# SEE: <http://rosettacode.org/wiki/Bitwise_operations>
-# Without logical right shift
module bitwise_operations
fun bitwise(a, b: Int)
do
module bitwise_operations
fun bitwise(a, b: Int)
do
- print "a and b: { a.bin_and(b) }"
- print "a or b: { a.bin_or(b) }"
- print "a xor b: { a.bin_xor(b) }"
- print "not a: { a.bin_not }"
+ print "a and b: { a & b }"
+ print "a or b: { a | b }"
+ print "a xor b: { a ^ b }"
+ print "not a: { ~a }"
print "a << b: { a << b }"
print "a >> b: { a >> b }"
end
print "a << b: { a << b }"
print "a >> b: { a >> b }"
end