* test/bigdecimal/test_bigdecimal.rb (test_sqrt_bigdecimal): wrong

precision specification.  a patch from TAKANO Mitsuhiro
  <takano32 at jus.or.jp> in [ruby-dev:36634].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-09-30 08:06:20 +00:00
Родитель 8bfa0ac869
Коммит 1eeb3e151e
2 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Tue Sep 30 17:04:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* test/bigdecimal/test_bigdecimal.rb (test_sqrt_bigdecimal): wrong
precision specification. a patch from TAKANO Mitsuhiro
<takano32 at jus.or.jp> in [ruby-dev:36634].
Tue Sep 30 16:53:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (stmt): returns non zero. [ruby-dev:36633]

Просмотреть файл

@ -466,9 +466,9 @@ class TestBigDecimal < Test::Unit::TestCase
x = BigDecimal.new("0.09")
assert_in_delta(0.3, x.sqrt(1), 0.001)
x = BigDecimal.new((2**100).to_s)
assert_equal(1125899906842624, x.sqrt(1))
assert_equal(1125899906842624, x.sqrt(2))
assert_equal(1125899906842624, x.sqrt(3)) # I don't understand the meaning of argument...
assert_equal(1125899906842624, x.sqrt(100))
assert_equal(1125899906842624, x.sqrt(200))
assert_equal(1125899906842624, x.sqrt(300)) # I don't understand the meaning of argument...
x = BigDecimal.new("-" + (2**100).to_s)
assert_raise(FloatDomainError) { x.sqrt(1) }
x = BigDecimal.new((2**200).to_s)