1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use bit_length.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2015-01-10 11:40:20 +00:00
parent 8ed8e0ba41
commit 04196d1f8c

View file

@ -300,7 +300,7 @@ class TestIntegerComb < Test::Unit::TestCase
assert_equal(a, c >> b, "(#{a} << #{b}) >> #{b}")
assert_equal(a * 2**b, c, "#{a} << #{b}")
end
0.upto(c.size*8+10) {|nth|
0.upto(c.bit_length+10) {|nth|
assert_equal(a[nth-b], c[nth], "(#{a} << #{b})[#{nth}]")
}
}
@ -317,7 +317,7 @@ class TestIntegerComb < Test::Unit::TestCase
assert_equal(a, c << b, "(#{a} >> #{b}) << #{b}")
assert_equal(a * 2**(-b), c, "#{a} >> #{b}")
end
0.upto(c.size*8+10) {|nth|
0.upto(c.bit_length+10) {|nth|
assert_equal(a[nth+b], c[nth], "(#{a} >> #{b})[#{nth}]")
}
}