diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-03 07:47:00 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-03 07:47:00 +0000 |
commit | 1c3e07f0d6d237222192f41c84716c15731b3158 (patch) | |
tree | b207b1f80d418c4b57eec8a213d83e4069d95406 /test/bigdecimal/test_bigdecimal.rb | |
parent | 59cad45f9963b359b16c1b9a9324b78e5e0873d5 (diff) | |
download | ruby-1c3e07f0d6d237222192f41c84716c15731b3158.tar.gz |
* ext/bigdecimal/bigdecimal.c (Init_bigdecimal): add two new constants BigDecimal::INFINITY and BigDecimal::NAN.
* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath.exp): modify the behaviors for infinity arguments as same as Math.exp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/bigdecimal/test_bigdecimal.rb')
-rw-r--r-- | test/bigdecimal/test_bigdecimal.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index b622358758..a699d0c488 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -709,4 +709,12 @@ class TestBigDecimal < Test::Unit::TestCase ensure GC.stress = stress end + + def test_INFINITY + assert(BigDecimal::INFINITY.infinite?, "BigDecimal::INFINITY is not a infinity") + end + + def test_NAN + assert(BigDecimal::NAN.nan?, "BigDecimal::NAN is not NaN") + end end |