summaryrefslogtreecommitdiff
path: root/test/ruby/test_float.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_float.rb')
-rw-r--r--test/ruby/test_float.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index 568c56181a..92c2062948 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -51,4 +51,22 @@ 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)
+ a = Float("0." + "00" * Float::DIG + "1")
+ assert(a != 0.0)
+ a = Float("+0." + "00" * Float::DIG + "1")
+ assert(a != 0.0)
+ a = Float("-0." + "00" * Float::DIG + "1")
+ assert(a != 0.0)
+ # add expected behaviour here.
+ end
end