Sha256: 2655b8ebe4508cd9b615c4cc0c7f0ceea69fb5f1d1e9f40cb12778c031d313e2
Contents?: true
Size: 532 Bytes
Versions: 70
Compression:
Stored size: 532 Bytes
Contents
describe "Numeric#>> with n >> m" do it "returns n shifted right m bits when n > 0, m > 0" do (2 >> 1).should == 1 end it "returns n shifted right m bits when n < 0, m > 0" do (-2 >> 1).should == -1 end it "returns 0 when n == 0" do (0 >> 1).should == 0 end it "returns n when n > 0, m == 0" do (1 >> 0).should == 1 end it "returns n when n < 0, m == 0" do (-1 >> 0).should == -1 end it "returns 0 when m > 0 and m == p where 2**p > n >= 2**(p-1)" do (4 >> 3).should == 0 end end
Version data entries
70 entries across 70 versions & 3 rubygems