I've been playing with calculating sunrise/sunset on an arduino Diecimila. Consider the following code fragment and the comments:

// debugging the J calculation

double J1 = 2451545; // ok - got 2451545

double J2 = 0.0009; // ok - got 0.0009

double J3 = 2*M_PI; // ok - got 6.283185

double J4 = Lw/J3; // ok - got 0.215978

double J5 = J1 + J2; // wrong - got 2451545.000000

double J6 = J5 + J4; // wrong - got 2451545.250000 - even

// assuming the bug is in the serial

// library println() function, its

// still wrong.

double J7 = J6 + n; // ok - ignoring previous errors, this

// gives 2455513.250000 which is correct.

I might have thought that there was a problem with a cast somewhere, but the bug occurs well after we've established the type of each variable *and* verified correct results. Interestingly, only addition appears to be affected. All other operations appear fine.