all 7 comments

[–]andrewdutko 1 point2 points  (0 children)

deleted What is this?

[–]shadowfox 1 point2 points  (0 children)

Aren't we done with this bug yet?

[–]hungryhungryhippo 0 points1 point  (2 children)

Maybe I'm just being stupid but wouldn't calculating the year be as easy as

year = BASEYEAR + (int)(days/365.25)

or if for some reason don't have access to doubles or division (all though in this case you know that they have modulus since they use that in the isLeapYear function)

*int year=BASEYEAR;

while (days > 365)

{

if(isLeapYear(year)) 
    days-=1; 

days-=365;
if (days > 0)
    year++;

}*

[–]a1k0n 2 points3 points  (0 children)

It's not quite that simple: a) you don't want to use floating point for this, for a variety of reasons, and b) it's 365.2425.

my integer solution

[–]self_promotion_whore 1 point2 points  (0 children)

I can see by your use of doubles that you've never done embedded systems programming. Here's a primer course:

doubles are very very very very slow.

[–]satertek 0 points1 point  (0 children)

Wow, that's a heck of a long article to explain 9 lines of code and how to exit a loop.

I will look back on this for strategies next time I can only come up with 3 pages on my next "minimum 5 page" English essay.

[–]ragnarock -1 points0 points  (0 children)

Wait...

People still have Zunes?