From 58c20fbf61037c19cb38f70bd801a2893c6b5626 Mon Sep 17 00:00:00 2001 From: ocean Date: Sun, 30 Oct 2005 17:37:31 +0000 Subject: * test/ruby/test_float.rb (test_precision): test by assert_in_delta. [ruby-dev:27575] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_float.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 741093fa61..fb180ff81b 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -40,10 +40,10 @@ class TestFloat < Test::Unit::TestCase end def test_precision - #s = "3.7517675036461267e+17" - #assert(s == sprintf("%.16e", s.to_f)) - f = 3.7517675036461267e+17 - assert_equal(f, sprintf("%.16e", f).to_f) + u = 3.7517675036461267e+17 + v = sprintf("%.16e", u).to_f + assert_in_delta(u, v, u.abs * Float::EPSILON) + assert_in_delta(u, v, v.abs * Float::EPSILON) end def test_symmetry_bignum # [ruby-bugs-ja:118] -- cgit v1.2.3