diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-04 02:58:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-04 02:58:45 +0000 |
commit | 19ad459b637d9e0e5ad37f261383027e27140073 (patch) | |
tree | 52dc621e33629aa8955ec1b1234c9504dcd99b76 /range.c | |
parent | 81fa4f2da68825089ab57be05d6e4f6a2995ff32 (diff) |
* numeric.c (ruby_float_step): extracted from num_step().
* range.c (range_step): uses ruby_float_step() for float range.
[ruby-dev:37691]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r-- | range.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -273,6 +273,8 @@ step_i(i, arg) return Qnil; } +extern int ruby_float_step _((VALUE from, VALUE to, VALUE step, int excl)); + /* * call-seq: * rng.step(n=1) {| obj | block } => rng @@ -343,6 +345,9 @@ range_step(argc, argv, range) } } + else if (ruby_float_step(b, e, step, EXCL(range))) { + /* done */ + } else if (rb_obj_is_kind_of(b, rb_cNumeric) || !NIL_P(rb_check_to_integer(b, "to_int")) || !NIL_P(rb_check_to_integer(e, "to_int"))) { |