diff options
author | Adam Bard <github@adambard.com> | 2015-10-31 19:04:51 +0800 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2015-10-31 19:04:51 +0800 |
commit | aa4631e4b83c9a04afb4f937b0252bca69790911 (patch) | |
tree | 30ed5f4064d92c6b464975d559041236828ff262 /ruby.html.markdown | |
parent | 15c9543ebc12b81758cade21d8532e07d27ebc8b (diff) | |
parent | 33337d045d5af8155e9ef3418f6f766298977a15 (diff) |
Merge pull request #1908 from farisj/ruby-add-bitwise-operators
Adds bitwise operators (AND, OR, XOR)
Diffstat (limited to 'ruby.html.markdown')
-rw-r--r-- | ruby.html.markdown | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ruby.html.markdown b/ruby.html.markdown index 6114c14e..8720fec6 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -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 |