std.date proposal

Walter Bright newshound at digitalmars.com
Wed Apr 5 02:04:52 PDT 2006


Fredrik Olsson wrote:
>>> A double can represent infinity, -infinity, and not a number can be 
>>> not a date.
>>
>> std.date's d_time offers d_time_nan, which fills the role of nan for 
>> times. I don't see a purpose for infinity or -infinity when dealing 
>> with calendar dates or file times. There is a purpose for such when 
>> doing physics math, but that is way beyond the scope of std.date.
>>
> I find a good infinity to be nice to have, when calling say something 
> like: isInRange(aDate, now(), infinity); A date way into the future 
> would be just as good for most purposes, but clean and readable code is 
> nice.

Why not write it as:

	if (now() <= aDate) ...

?



More information about the Digitalmars-d-announce mailing list