From: Randall Alexander Date: 2009-03-21T14:20:38+09:00 Subject: Re: & - FixNum - method doubt --0016e646074c1df73004659a2476 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit I am just learning Ruby but it looks like the binary intersection of the true bits. In shorter terms a binary "and" command. 3&6=2 in binary 011&110=010 3&7=3 in binary 011&111=011 7&21=5 in binary 00111&10101=00101 Randy On Sat, Mar 21, 2009 at 1:04 AM, jazzez ravi wrote: > Hi All, > > irb> a=12 > irb> a.methods > > it contains & method > > So I tried like .. > irb> 3&6 > => 2 > irb> 3&7 > => 3 > irb> 7&21 > => 5 > > I can't understand how it works. Anyone help me > > > Thanks, > P.Raveendran > http://raveendran.wordpress.com > -- > Posted via http://www.ruby-forum.com/. > > -- Randy http://randallalexander-os.blogspot.com/ http://randallalexander-java.blogspot.com/ http://randallalexander-flex.blogspot.com/ http://randallalexander-ruby.blogspot.com/ --0016e646074c1df73004659a2476--