iota with custom boundary conditions

monarch_dodra monarchdodra at gmail.com
Tue Nov 13 06:43:36 PST 2012


On Tuesday, 13 November 2012 at 14:20:45 UTC, Joseph Rushton 
Wakeling wrote:
> On 11/13/2012 03:08 PM, bearophile wrote:
>> In general is it a good idea to use iota with floating point 
>> arguments?
>
> I guess you're thinking of the difficulty of making exact 
> equality comparisons between the current value and the end 
> value?  A floating-point iota certainly allows you to represent 
> certain things quite elegantly, although I suppose for safety's 
> sake you might want to use an integer-based iota and calculate 
> FP values from that.
>
> In any case, the usefulness of closed-vs-open boundary 
> conditions isn't limited to FP iota, although it's certainly 
> the main use case.

The only time I could possibly see a use for open-close in iota, 
is when you want to iterate all the way to T.max.

But I don't think that use-case justifies the change.


More information about the Digitalmars-d mailing list