Project

General

Profile

Misc #10809 » reorder_test_cbrt_and_add_a_assertion.patch

gogotanaka (Kazuki Tanaka), 02/01/2015 12:23 AM

View differences:

test/ruby/test_math.rb
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_equal(1.0/0, Math.cbrt(1.0/0))
end
def test_frexp
check(0.0, Math.frexp(0.0).first)
assert_equal(0, Math.frexp(0).last)
......
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
-
(1-1/5)