diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-09 14:38:11 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-09 14:38:11 +0000 |
commit | 6452c26b9c04f1eb5cf8bd31297f60462d45d182 (patch) | |
tree | 0abe254da8d5a51af55cef8f9e2be078c43acbfe | |
parent | 6de9e40eacc4f961624b26118b25abbc3191b998 (diff) | |
download | ruby-6452c26b9c04f1eb5cf8bd31297f60462d45d182.tar.gz ruby-6452c26b9c04f1eb5cf8bd31297f60462d45d182.tar.xz ruby-6452c26b9c04f1eb5cf8bd31297f60462d45d182.zip |
* test/ruby/test_float.rb: added test_strtod to test Float("0").
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | test/ruby/test_float.rb | 12 |
2 files changed, 16 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Sun May 9 23:34:51 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp> + + * test/ruby/test_float.rb: added test_strtod to test Float("0"). + Sun May 9 13:24:24 2004 WATANABE Hirofumi <eban@ruby-lang.org> * lib/yaml/store.rb: use FileUtils::copy. diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 568c56181..6fae9bf49 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -51,4 +51,16 @@ class TestFloat < Test::Unit::TestCase b = 100000000000000000000000.0 assert_equal(a == b, b == a) end + + def test_strtod + a = Float("0") + assert(a.abs < Float::EPSILON) + a = Float("0.0") + assert(a.abs < Float::EPSILON) + a = Float("+0.0") + assert(a.abs < Float::EPSILON) + a = Float("-0.0") + assert(a.abs < Float::EPSILON) + # add expected behaviour here. + end end |