Feature #10225 » _ test_math.rb Add tests for Math.normcdf.PATCH
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))
|