Project

General

Profile

Feature #10225 » _ test_math.rb Add tests for Math.normcdf.PATCH

gogotanaka (Kazuki Tanaka), 09/11/2014 06:23 AM

View differences:

test/ruby/test_math.rb
check(0, Math.erfc(1.0 / 0.0))
end
def test_normcdf
check(0.5, Math.normcdf(0))
check(0.9772498680518208, Math.normcdf(2))
check(1.0, Math.normcdf(-2) + Math.normcdf(2))
check(1.0, Math.normcdf(Float::INFINITY))
check(0.0, Math.normcdf(-Float::INFINITY))
end
def test_gamma
sqrt_pi = Math.sqrt(Math::PI)
check(4 * sqrt_pi / 3, Math.gamma(-1.5))
(2-2/3)