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

* 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
This commit is contained in:
matz 2007-08-21 20:57:48 +00:00
parent c5e4cd0638
commit 40b5c7b26c
3 changed files with 3311 additions and 269 deletions

View file

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