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

* range.c (range_step): should not round step into integer if

begin and end are numeric.  [ruby-core:15990]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-04-03 17:20:48 +00:00
parent 9ee1ced6d9
commit 4d87d07782
3 changed files with 12 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Fri Apr 4 02:17:06 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* range.c (range_step): should not round step into integer if
begin and end are numeric. [ruby-core:15990]
Tue Apr 1 14:43:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: get rid of empty expansion.

View file

@ -322,7 +322,6 @@ range_step(argc, argv, range)
else {
VALUE tmp = rb_to_int(step);
unit = rb_cmpint(tmp, step, INT2FIX(0));
step = tmp;
}
if (unit < 0) {
rb_raise(rb_eArgError, "step can't be negative");
@ -354,8 +353,10 @@ range_step(argc, argv, range)
rb_iterate((VALUE(*)_((VALUE)))str_step, (VALUE)args, step_i,
(VALUE)iter);
}
else if (rb_obj_is_kind_of(b, rb_cNumeric)) {
ID c = rb_intern(EXCL(range) ? "<" : "<=");
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"))) {
ID c = EXCL(range) ? '<' : rb_intern("<=");
while (RTEST(rb_funcall(b, c, 1, e))) {
rb_yield(b);

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.8.6"
#define RUBY_RELEASE_DATE "2008-04-01"
#define RUBY_RELEASE_DATE "2008-04-03"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20080401
#define RUBY_RELEASE_CODE 20080403
#define RUBY_PATCHLEVEL 5000
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 6
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 1
#define RUBY_RELEASE_DAY 3
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];