> It does work with the full year, you just have to get the order of stuff= =20 > 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 >=20 > 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 then 504 * 4 =3D 2016, then 2016 / 3 =3D 672 Your line 1 + ((2010 - 2008 + 2) / 3) =3D 1 + 4/3 by "my" order would give the result 1 + ((2010 - 2010)/3) =3D 1 + 0/3 because the ( ) outside 2010 - 2008 + 2 have precedence over /3 > There is an example here: > http://williams.best.vwh.net/sunrise_sunset_example.htm Thanks. That's helpful in seeing how the rules were bent (IMVHO) to get the right answer Harumph ;-) Joe --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .