mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 05:25:34 +02:00
* test/ruby/test_math.rb(test_cbrt): Add an assertion for Math.cbrt(1.0/0)
and move #test_cbrt to more proper place. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fbc8841a8f
commit
87e3aec84d
2 changed files with 13 additions and 7 deletions
|
@ -183,6 +183,14 @@ class TestMath < Test::Unit::TestCase
|
|||
assert_raise(Math::DomainError) { Math.sqrt(-1.0) }
|
||||
end
|
||||
|
||||
def test_cbrt
|
||||
check(1, Math.cbrt(1))
|
||||
check(-2, Math.cbrt(-8))
|
||||
check(3, Math.cbrt(27))
|
||||
check(-0.1, Math.cbrt(-0.001))
|
||||
assert_nothing_raised { assert_infinity(Math.cbrt(1.0/0)) }
|
||||
end
|
||||
|
||||
def test_frexp
|
||||
check(0.0, Math.frexp(0.0).first)
|
||||
assert_equal(0, Math.frexp(0).last)
|
||||
|
@ -282,11 +290,4 @@ class TestMath < Test::Unit::TestCase
|
|||
|
||||
assert_raise(Math::DomainError) { Math.lgamma(-Float::INFINITY) }
|
||||
end
|
||||
|
||||
def test_cbrt
|
||||
check(1, Math.cbrt(1))
|
||||
check(-2, Math.cbrt(-8))
|
||||
check(3, Math.cbrt(27))
|
||||
check(-0.1, Math.cbrt(-0.001))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue