Jan 01 2009 ∞
The code that allegedly broke the Zune
Via jstn.
while (days > 365) {
if (IsLeapYear(year)) {
if (days > 366) {
days -= 366;
year += 1;
}
} else {
days -= 365;
year += 1;
}
}
Out of curiosity, why was this being rewritten by Freescale or Microsoft at all? This has been a solved problem for a very long time.
(Also, this is very ugly C style in many places. I expected better from Microsoft.)
All original content is licensed under the Creative Commons Attribution 3.0 U.S. License except that which is quoted from elsewhere or attributed to others. In short, you may reproduce, reblog, and modify my content, but you must provide proper attribution.