Bug #9570

Something wrong with Enumerator#size ?

Added by 东 许 over 1 year ago. Updated about 1 year ago.

[ruby-core:61106]
Status:Closed
Priority:Normal
Assignee:Marc-Andre Lafortune
ruby -v:Ruby 2.0.0-p451 Backport:1.9.3: DONTNEED, 2.0.0: DONE, 2.1: DONE

Description

enum = 2.step(1, 3)
enum.size #=> 1

It should be 0, shouldn't it? ( Windows )

Associated revisions

Revision 45187
Added by Nobuyoshi Nakada over 1 year ago

numeric.c: check signs before division

  • numeric.c (ruby_num_interval_step_size): check signs and get rid of implementation dependent behavior of negative division. [Bug #9570]

Revision 45187
Added by Nobuyoshi Nakada over 1 year ago

numeric.c: check signs before division

  • numeric.c (ruby_num_interval_step_size): check signs and get rid of implementation dependent behavior of negative division. [Bug #9570]

Revision 45205
Added by Marc-Andre Lafortune over 1 year ago

  • numeric.c: Simplify [Bug #9570]

Revision 45205
Added by Marc-Andre Lafortune over 1 year ago

  • numeric.c: Simplify [Bug #9570]

Revision 46226
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) r45187,r45205,r45206,r45212,r45213: [Backport #9570]

* numeric.c (ruby_num_interval_step_size): check signs and get rid
  of implementation dependent behavior of negative division.
   [Bug #9570]

History

#1 Updated by Marc-Andre Lafortune over 1 year ago

  • Target version changed from next minor to current: 2.2.0
  • Assignee changed from Yukihiro Matsumoto to Marc-Andre Lafortune

Indeed, I'll fix this asap. Thanks

#2 Updated by Nobuyoshi Nakada over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Applied in changeset r45187.


numeric.c: check signs before division

  • numeric.c (ruby_num_interval_step_size): check signs and get rid of implementation dependent behavior of negative division. [Bug #9570]

#3 Updated by Marc-Andre Lafortune over 1 year ago

Hi Nobu.
While I appreciate the intention, why did you fix this while I stated I would and assigned the issue to myself?

#4 Updated by Nobuyoshi Nakada over 1 year ago

Sorry, I did it last night but had no time to commit, and missed to check the latest status this morning.

#5 Updated by Tomoyuki Chikanaga over 1 year ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1: REQUIRED

#6 Updated by Tomoyuki Chikanaga over 1 year ago

  • Backport changed from 1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONE, 2.1: REQUIRED

r45187, r45205, r45212 and r45213 were backported to ruby_2_0_0 at r45250.

#7 Updated by Tomoyuki Chikanaga about 1 year ago

  • Backport changed from 1.9.3: DONTNEED, 2.0.0: DONE, 2.1: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONE, 2.1: DONE

r45187, r45205, r45206, r45212 and r45213 were backported into ruby_2_1 at 46226.

Also available in: Atom PDF