Project

General

Profile

Actions

Bug #16612

closed

Enumerator::ArithmeticSequence#last with float range produces incorrect value

Added by bjfish (Brandon Fish) about 4 years ago. Updated almost 3 years ago.

Status:
Closed
Target version:
-
[ruby-core:97075]

Description

Steps to reproduce

% 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:

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0