From 07b314f07b0fa45838474b4f8c7ef32c746c6536 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 12 May 2010 01:57:08 +0000 Subject: * numeric.c (flo_to_s): make minimum string representation. [ruby-core:30145] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_float.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby/test_float.rb') diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index a0d72be03d..03d9c94766 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -136,6 +136,13 @@ class TestFloat < Test::Unit::TestCase assert_equal("NaN", (inf / inf).to_s) assert_equal("1.0e+18", 1000_00000_00000_00000.0.to_s) + + bug3273 = '[ruby-core:30145]' + [0.21611564636388508, 0.56].each do |f| + s = f.to_s + assert_equal(f, s.to_f, bug3273) + assert_not_equal(f, s.chop.to_f, bug3273) + end end def test_coerce -- cgit v1.2.3