Just a side note: You might want to give TargetLink a try.
Just a side note: You might want to give TargetLink a try.
Well, you are also calculating leap, and allowing for the 100 year mark, and you have month scaled from 1 rather than 0. So the comparision is not quite fair. It also requires generating object code for various machines :-) However I suspect that mine will be more understandable. :-)
-- [mail]: Chuck F (cbfalconer at maineline dot net) [page]:
This will work for quite longer period:
u8 leap_year(u16 year) { u16 utmp; u8 leap = 0;
if(!(year & 0x03)) { utmp = (u16)((((u32)year)*41943)>>16); utmp++;
if(!(utmp&0x3E)) { if(!(utmp&0xC0)) leap = 1; else leap = 0; } else leap = 1; }
return leap; }
Vladimir Vassilevsky DSP and Mixed Signal Design Consultant
skrev i meddelandet news: snipped-for-privacy@34g2000hsh.googlegroups.com...
Don't forget that the clock changes by one hour twice a year for summertime...
-- Best Regards, Ulf Samuelsson
And that for the southern hemisphere summer straddles the year-end.
Peter
Don't forget about the leap seconds...
Vladimir Vassilevsky DSP and Mixed Signal Design Consultant
Why?
Robert
** Posted fromElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.