Foreach Range Statement

Sean Kelly sean at f4.ca
Mon Jul 23 08:43:14 PDT 2007


Don Clugston wrote:
> Bill Baxter wrote:
>> Don Clugston wrote:
>>
>>> Consider
>>> -real.infinity..real.infinity
>>> Are the infinities part of the range? If not, how do you specify a 
>>> range which includes infinity?
>>
>> Does it matter that much?  I suppose it would be cool if it did 
>> something really consistent, but Numpy just craps out and gives you an 
>> empty list, and Matlab raises an error "Maximum variable size allowed 
>> by the program is exceeded".
> 
> I think that if you can't specify a range including an infinity, then 
> floating point ranges don't make sense. Especially, I really don't like 
> the idea that -real.infinity..real.infinity would include -infinity, but 
> not +infinity.

Hm... what if I wanted a range that included ulong.max?  Is there any 
way to do that either?  I don't suppose ulong.max+1 works in that case?
   I know it would be a tad weird because infinity+1 == infinity, but 
perhaps this is one case where the semantics should just be consistent 
with everything else.


Sean



More information about the Digitalmars-d mailing list