summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-10 11:40:20 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-10 11:40:20 +0000
commit04196d1f8cf1a3e8095a8cd4d7f1e6dbaa323203 (patch)
treeaea7156eedba11c03d9d77ee6d56382712796205
parent8ed8e0ba417390c117763073c44ebe45eb8afa68 (diff)
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.rb4
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}]")
}
}