Ranges redux

Tim Peierls tim at peierls.net
Mon May 13 06:02:05 PDT 2013


On Mon, May 13, 2013 at 6:30 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:

> Sequentially DoubleStream.range is currently equivalent to the following:
>
>      *     long size = (long) Math.ceil((startInclusive - endExclusive) /
> step);
>      *     long i = 0
>      *     for (double v = startInclusive; i < size; i++, v =
> startInclusive + step * i) {
>      *         ...
>      *     }
>
> If startInclusive + step * size == endExclusive then the range could be
> closed, otherwise half-open.
>
> Is that a reasonable expectation?
>

This feels like it would surprise people more often than not.

--tim


More information about the lambda-libs-spec-observers mailing list