John Darrington <[EMAIL PROTECTED]> writes:

> /* Takes a count of days from 14 Oct 1582 and returns the
>    corresponding weekday 1...7, with 1=Sunday. */
> int
> calendar_offset_to_wday (int ofs)
> {
>   int wday = (ofs - EPOCH + 1) % 7 + 1;
>   if (wday <= 0)
>     wday += 7;
>   return wday;
> }
>
>
> Can the the condition in the above IF statement ever be true?  So far
> as I can tell, only if the ofs < (EPOCH - 1) but dates before EPOCH
> are not permitted.

I think that the function, as is, works for any value of `ofs'.
On those grounds, I don't think changing the adjustment to an
assertion would really be an improvement.
-- 
"If a person keeps faithfully busy each hour of the working day, he
 can count on waking up some morning to find himself one of the
 competent ones of his generation."
--William James


_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to