year = ORIGINYEAR; /* = 1980 */ while (days > 365+IsLeapYear(year)) { days -= 365+IsLeapYear(year); year++; }