diff options
author | Jacob Ward <jacobward1898@gmail.com> | 2015-10-31 20:27:51 -0600 |
---|---|---|
committer | Jacob Ward <jacobward1898@gmail.com> | 2015-10-31 20:27:51 -0600 |
commit | 5d09566ee4881028cd53dee83ae27343beb8269d (patch) | |
tree | d5d48488f23e08690f1ec54610c9fe81e34d2fe8 /ruby.html.markdown | |
parent | 08b43e21f1a273d5ca471e0accdf46ba706a4cd5 (diff) | |
parent | dbe6184519860e526432c4987a6f67d6c0acf38e (diff) |
Merge remote-tracking branch 'adambard/master'
Diffstat (limited to 'ruby.html.markdown')
-rw-r--r-- | ruby.html.markdown | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ruby.html.markdown b/ruby.html.markdown index 998b4bf7..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 @@ -77,6 +81,11 @@ false.class #=> FalseClass 2 <= 2 #=> true 2 >= 2 #=> true +# Combined comparison operator +1 <=> 10 #=> -1 +10 <=> 1 #=> 1 +1 <=> 1 #=> 0 + # Logical operators true && false #=> false true || false #=> true |