1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
ocean 2005-10-30 17:37:31 +00:00
parent 5e9627d80a
commit 58c20fbf61
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Mon Oct 31 02:31:41 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* test/ruby/test_float.rb (test_precision): test by assert_in_delta.
[ruby-dev:27575]
Sat Oct 29 16:56:03 2005 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb: added seven predicates sunday? to saturday?.

View file

@ -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]