diff --git a/test/ruby/test_math.rb b/test/ruby/test_math.rb index 4d819d7..da50e9f 100644 --- a/test/ruby/test_math.rb +++ b/test/ruby/test_math.rb @@ -218,6 +218,14 @@ class TestMath < Test::Unit::TestCase 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))