diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_math.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb index c4d0ff93f2..a6d2df284e 100644 --- a/test/ruby/test_math.rb +++ b/test/ruby/test_math.rb @@ -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 |