mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Merge pull request #1908 from farisj/ruby-add-bitwise-operators
Adds bitwise operators (AND, OR, XOR)
This commit is contained in:
commit
aa4631e4b8
@ -41,7 +41,11 @@ You shouldn't either
|
||||
35 / 5 #=> 7
|
||||
2**5 #=> 32
|
||||
5 % 3 #=> 2
|
||||
5 ^ 6 #=> 3
|
||||
|
||||
# Bitwise operators
|
||||
3 & 5 #=> 1
|
||||
3 | 5 #=> 7
|
||||
3 ^ 5 #=> 6
|
||||
|
||||
# Arithmetic is just syntactic sugar
|
||||
# for calling a method on an object
|
||||
|
Loading…
Reference in New Issue
Block a user