Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Bitwise-operations/Scala/bitwise-operations.scala
Normal file
11
Task/Bitwise-operations/Scala/bitwise-operations.scala
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
def bitwise(a: Int, b: Int) {
|
||||
println("a and b: " + (a & b))
|
||||
println("a or b: " + (a | b))
|
||||
println("a xor b: " + (a ^ b))
|
||||
println("not a: " + (~a))
|
||||
println("a << b: " + (a << b)) // left shift
|
||||
println("a >> b: " + (a >> b)) // arithmetic right shift
|
||||
println("a >>> b: " + (a >>> b)) // unsigned right shift
|
||||
println("a rot b: " + Integer.rotateLeft(a, b)) // Rotate Left
|
||||
println("a rol b: " + Integer.rotateRight(a, b)) // Rotate Right
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue