[phobos] Simplify iota for floating-point types?

Robert Jacques sandford at jhu.edu
Thu Dec 23 20:33:07 PST 2010


On Thu, 23 Dec 2010 11:20:24 -0700, Andrei Alexandrescu  
<andrei at erdani.com> wrote:

> Per the recent discussion comparing D with Lua, tests suggest that iota  
> for double is too slow. This is a necessity if iota is a bidirectional  
> or random-access range. If we allow it to be a forward range, then  
> performance would be significantly increased.
>
> Do you agree with making iota for floating-point types a forward range?
>
>
> Andrei

I had thought the major slowdown was using code like 'start + step * i' as  
opposed to 'current += step', which, although much faster is fundamentally  
broken, as with floating point numbers x = (x+1), etc. Am I mistaken?


More information about the phobos mailing list