[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CalDat



m.hadfield@niwa.cri.nz ("Mark Hadfield") writes:

> But what about this:
> 
> CALDAT, double(2529161.36), Month, Day, Year, Hour, Minute, second
> print, Month, Day, Year, Hour, Minute, second
> ;           7           4        2212          18           0
> 0.00000000
> 
> i.e. CALDAT gives the same result for double(2529161.36) as it does for
> 2529161.36.

Well, of course it should. The number 2529161.36 cannot be accurately 
represented as float. You can test this with 
IDL> print,float(2529161.36d0),format='(f15.6)' 
 2529161.250000


> I suggest that there is nothing wrong with CALDAT, but that floats have
> inadequate precision to represent Julian dates. The following shows that
> they are only accurate to ~0.3 days.
> 
> ma = machar()  &  print, 2529161.36*ma.eps
> ;     0.301500
> 

That hits the nail right on.

Martin

-- 
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
[[ Dr. Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 41173-298                  [[
[[ martin.schultz@dkrz.de                                        [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[