On 13 September 2011 17:19, Yusuke ENDOH <mame / tsg.ne.jp> wrote:
> Hello,
>
> 2011/9/13 Vit Ondruch <v.ondruch / tiscali.cz>:
>> Please first see the commit [1] and then tell me why the original test case should fail? Actually it fails on i386 and succeeds on x86_64 which is a bit suspicious. So I dig a bit deeper with my colleagues and we found that the test was just fine, but the implementation has issues on i386. This should be hopefully fixed with patch attached to this issue [2]. More detailed explanation can be found in Red Hat bugzilla [3].
>
>
> Vit, did you run Test E in the original ticket in Red Hat buzilla?
> Indeed, Tests A--D and F behave as you expected with your patch applied:
>
> $ ./miniruby -e 'p (1.0...9.4).step(1.2).to_a'
> [1.0, 2.2, 3.4, 4.6, 5.8, 7.0, 8.2]
> $ ./miniruby -e 'p (1.0...6.4).step(1.8).to_a'
> [1.0, 2.8, 4.6]
> $ ./miniruby -e 'p (1.0...7.3).step(2.1).to_a'
> [1.0, 3.1, 5.2]
> $ ./miniruby -e 'p (1.0...7.6).step(2.2).to_a'
> [1.0, 3.2, 5.4]
> $ ./miniruby -e 'p (1.0...146.6).step(18.2).to_a'
> [1.0, 19.2, 37.4, 55.599999999999994, 73.8, 92.0,
> 110.19999999999999, 128.39999999999998]
>
> However, Test E still looks like "apparently wrong" on my i386:
>
> $ ./miniruby -e 'p (1.0...128.4).step(18.2).to_a'
> [1.0, 19.2, 37.4, 55.599999999999994, 73.8, 92.0,
> 110.19999999999999, 128.39999999999998]

That happens on both i386 and amd64 for me.

The problem is different than the one discussed above, though.

Here the excluded end of the interval is reached (through rounding
error) whereas in the above post the step before the excluded end was
not reached.

Thanks

Michal