Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

zune date bug

Name: Anonymous 2008-12-31 21:14

Name: Anonymous 2008-12-31 21:32

year = ORIGINYEAR; /* = 1980 */

while (days > 365)
{
    if (IsLeapYear(year) && (days > 366))
    {
         days -= 366;
         year += 1;
    }
    else
    {
        days -= 365;
        year += 1;
    }
}

fixed?

Name: Anonymous 2008-12-31 21:36

People actually use those crippleware things?

Name: Anonymous 2008-12-31 21:51

>>2

No, that would give you the wrong year.

So, either restructure it some more or throw in a break or something.

FFS, how did this code get anywhere near something in production.

Name: Anonymous 2008-12-31 21:53

year = ORIGINYEAR; /* = 1980 */

while(days>365+IsLeapYear(year)) {
 days -= 365+IsLeapYear(year);
 year++;
}


Pretty shitty how someone could screw up something as simple as this.

Name: Anonymous 2008-12-31 22:16

Since it won't happen again till 2012, they'll probably not bother fixing it and whatever device takes over from the Zune will have the same problem.

Name: Anonymous 2008-12-31 22:44

i wrote a leap year calculator when i was 6

Name: Anonymous 2008-12-31 22:55

What I really want to know is what caused the Y2K9 Shiichan bug.

Name: Anonymous 2008-12-31 22:56

>>8
some kind of horse i imagine

Name: Anonymous 2009-01-01 0:05

>>8
what bug?

Name: Anonymous 2009-01-01 3:44

Isn't a leap year just Year%4 == 0?

Name: Anonymous 2009-01-01 4:04

No, a leap year is divisible also by 100 and 400

Name: Anonymous 2009-01-01 4:06

>>11
!(year%(year%100?4:400))

Name: Anonymous 2009-01-01 9:14

days > 366 instead of days >= 366


*sigh* =[

Name: Anonymous 2009-01-01 9:28

Microsoft quality.

Name: Anonymous 2009-01-01 12:21

>>15
Microsoft quality

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List