From: brandon.j.fish@... Date: 2020-02-06T19:26:59+00:00 Subject: [ruby-core:97075] [Ruby master Bug#16612] Enumerator::ArithmeticSequence#last with float range produces incorrect value Issue #16612 has been reported by bjfish (Brandon Fish). ---------------------------------------- Bug #16612: Enumerator::ArithmeticSequence#last with float range produces incorrect value https://bugs.ruby-lang.org/issues/16612 * Author: bjfish (Brandon Fish) * Status: Open * Priority: Normal * ruby -v: 2.7.0 * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- **Steps to reproduce** ``` shell % ruby -e 'p ((0.24901079128550474)...(340.25008088980684)).step(34.00010700985213).last' 340.2500808898068 ``` **Expected result** Last value should match the value produced by the following: ``` shell ruby -e 'p ((0.24901079128550474)...(340.25008088980684)).step(34.00010700985213).to_a[-1]' 306.24997387995467 ``` **Environment** This was observed in versions `2.7.0` and `2.6.5`. -- https://bugs.ruby-lang.org/ Unsubscribe: