From: William Djaja Tjokroaminata Date: 2002-10-15T02:38:17+09:00 Subject: Re: & operation and if statment It is Item 12 in "Things That Newcomers to Ruby Should Know" (http://www.glue.umd.edu/~billtj/ruby.html) :) Regards, Bill ============================================================================ dblack@candle.superlink.net wrote: > On Tue, 15 Oct 2002, Robert McGovern wrote: >> I'm puzzled by the behaviour in the following run. I would expect line 2 >> to not print out "ouch" because the result of the if statement is 0 >> (verified online 8) >> $ irb >> irb(main):001:0> data = 0x00 >> 0 >> irb(main):002:0> puts "ouch" if (data & 0x80) >> ouch > Don't forget that 0 is true.