Bug or feature? iota has different semantics for integer and float arguments

Ali Çehreli acehreli at yahoo.com
Sat Jan 7 00:52:20 UTC 2023


On 1/6/23 15:23, Arredondo wrote:

 > then you get an exception (incorrect startup parameters).

Although that difference is a bug, iota does have a special floating 
point implementation to prevent the accumulation of floating point 
errors. I mention it as item 4 here:

   https://www.youtube.com/watch?v=gwUcngTmKhg&t=634s

Briefly, iota's regular popFront() is a trivial

   front += step

but it is

   ++n

for floating types so that front can be

   begin + (n * step)

for them.

The iota discussion starts at an earlier point in the video here:

   https://www.youtube.com/watch?v=gwUcngTmKhg&t=558s

Ali



More information about the Digitalmars-d-learn mailing list