mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Adds bitwise operators (AND, OR, XOR)
This commit is contained in:
parent
f0a4c88acf
commit
33337d045d
@ -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