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

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

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-10-06 00:02:44 +00:00
parent 919301c489
commit 2de01f01a7
2 changed files with 7 additions and 3 deletions

View file

@ -1,3 +1,9 @@
Mon Oct 6 09:00:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* test/bigdecimal/test_bigdecimal.rb (test_sqrt_bigdecimal): test
updated. a patch from TAKANO Mitsuhiro <takano32 at jus.or.jp>
in [ruby-dev:36669].
Sun Oct 5 23:34:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb ($config_h): now always defines for old libraries.

View file

@ -466,9 +466,7 @@ 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(100))
assert_equal(1125899906842624, x.sqrt(200))
assert_equal(1125899906842624, x.sqrt(300)) # I don't understand the meaning of argument...
assert_equal(true, x.sqrt(300).precs.last < x.sqrt(1200).precs.last)
x = BigDecimal.new("-" + (2**100).to_s)
assert_raise(FloatDomainError) { x.sqrt(1) }
x = BigDecimal.new((2**200).to_s)