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:
parent
8ed8e0ba41
commit
04196d1f8c
1 changed files with 2 additions and 2 deletions
|
@ -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}]")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue