diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-10 11:40:20 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-10 11:40:20 +0000 |
commit | 04196d1f8cf1a3e8095a8cd4d7f1e6dbaa323203 (patch) | |
tree | aea7156eedba11c03d9d77ee6d56382712796205 | |
parent | 8ed8e0ba417390c117763073c44ebe45eb8afa68 (diff) | |
download | ruby-04196d1f8cf1a3e8095a8cd4d7f1e6dbaa323203.tar.gz |
Use bit_length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_integer_comb.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_integer_comb.rb b/test/ruby/test_integer_comb.rb index e00e7588fd..9018518334 100644 --- a/test/ruby/test_integer_comb.rb +++ b/test/ruby/test_integer_comb.rb @@ -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}]") } } |