diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-21 20:57:48 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-21 20:57:48 +0000 |
commit | 40b5c7b26c3bd800b7e38a47a301973e87e6ae77 (patch) | |
tree | b7ddd04d3b52daf5b192e21ac61334882e22dbdd /test | |
parent | c5e4cd063838033dff617f360a5b670b9eedaece (diff) | |
download | ruby-40b5c7b26c3bd800b7e38a47a301973e87e6ae77.tar.gz |
* util.c (ruby_strtod): replaced by the implementation by David
M. Gay inspired by William D. Clinger's paper "How to Read Floating
Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101].
a patch from Satoshi Nakagawa <snakagawa AT infoteria.co.jp>.
[ruby-dev:31582]
* test/ruby/test_float.rb (TestFloat::test_float): add test for
precision.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_float.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 47b7bf6bc4..dfd1b5bb7e 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -11,6 +11,8 @@ class TestFloat < Test::Unit::TestCase assert_equal(3, 2.6.round) assert_equal(-2, (-2.4).truncate) assert((13.4 % 1 - 0.4).abs < 0.0001) + assert_equal("36893488147419111424", + sprintf("%20.0f", 36893488147419107329.0)) end def nan_test(x,y) |