At 02:08 AM 2/28/2011, you wrote: > > It does work with the full year, you just have to get the order of stuf= f > > right. I tried it with your first example and got 319 - for N3: > > > > 1 + ((2010 - 4 * (floor(2010 / 4) + 2) / 3) > > =3D 1 + ((2010 - 4 * (502) + 2) / 3) > > =3D 1 + ((2010 - 2008 + 2) / 3) > > =3D 1 + (floor(4/3)) > > =3D 2 > > > > N =3D 336 - (1 * 2) + 15 - 30 =3D 319 > >Well, I really did think I had the operator precedence correct > >( ) * / + - > >By "my" order > >(floor(2010 / 4)+2) is worked first =3D 504 No, the multiplication operator has precedence over addition (or subtractio= n, which are equal precedence), so we have to multiply by 4 before adding the = 2 (and the year). http://en.wikipedia.org/wiki/Order_of_operations The order of calculation might be clearer if they had grouped the '2' and t= he year, but I think they were trying to make it bit easier to understand what= is going on.. which is always good.. for example, one can easily see that this algorithm has a Y2K1 problem. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the rewar= d" speff@interlog.com Info for manufacturers: http://www.trexon.co= m Embedded software/hardware/analog Info for designers: http://www.speff.co= m --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .