From 7752fb4205ecf5de2021a7924c213516c8a8d858 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 6 May 2003 06:51:31 +0000 Subject: * object.c (rb_obj_methods): list singleton methods if recur argument is false; list all methods otherwise. * numeric.c (num_step): double epsilon to make "1.1.step(1.5,0.1)" to work. * ext/gdbm/gdbm.c (fgdbm_values_at): new method to replace select(index..). * ext/sdbm/init.c (fsdbm_values_at): ditto. * ext/dbm/dbm.c (fdbm_values_at): ditto. * ext/dbm/dbm.c (DBM::VERSION): defined. * ext/gdbm/testgdbm.rb: replace select with values_at. * ext/sdbm/testsdbm.rb: ditto. * ext/dbm/testdbm.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index e0a6011d5b..b5d275f892 100644 --- a/numeric.c +++ b/numeric.c @@ -905,14 +905,14 @@ num_step(argc, argv, from) } } else if (TYPE(from) == T_FLOAT || TYPE(to) == T_FLOAT || TYPE(step) == T_FLOAT) { - const double epsilon = DBL_EPSILON; + const double epsilon = DBL_EPSILON * 2; double beg = NUM2DBL(from); double end = NUM2DBL(to); double unit = NUM2DBL(step); double n = (end - beg)/unit; long i; - n = floor(n + n*epsilon + 1); + n = floor(n + n*epsilon) + 1; for (i=0; i