summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-11 10:26:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-11 10:26:05 +0000
commit1367f28a4973bf24be22ff274b5eb1aa67418627 (patch)
tree859854702529dde9b40e08a16799c23102bea331
parentc855854eeb3c12edfebe50bbf004cd5f9071eb30 (diff)
test_bigmath.rb: test_log
* test/bigdecimal/test_bigmath.rb (test_log): add basic test for BigMath.log. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/bigdecimal/test_bigmath.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigmath.rb b/test/bigdecimal/test_bigmath.rb
index 2ccdb510f9e..c553353d61e 100644
--- a/test/bigdecimal/test_bigmath.rb
+++ b/test/bigdecimal/test_bigmath.rb
@@ -60,4 +60,11 @@ class TestBigMath < Test::Unit::TestCase
assert_equal(BigDecimal("0.823840753418636291769355073102514088959345624027952954058347023122539489"),
atan(BigDecimal("1.08"), 72).round(72), '[ruby-dev:41257]')
end
+
+ def test_log
+ assert_equal(0, BigMath.log(BigDecimal("1.0"), 10))
+ assert_in_epsilon(Math.log(10)*1000, BigMath.log(BigDecimal("1e1000"), 10))
+ assert_raise(Math::DomainError) {BigMath.log(BigDecimal("0"), 10)}
+ assert_raise(Math::DomainError) {BigMath.log(BigDecimal("-1"), 10)}
+ end
end