Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#591 JULDAY returns wrong result for 01.01.1981 00:00.0

v1.0 (example)
closed-fixed
nobody
None
5
2014-02-28
2014-02-24
Igor
No

Description
Function JULDAY returns incorrect Julian day for 01.01.1981, 01.01.1985, 01.01.1989... that's it, for Jan 1 of the first year after a leap year. Did not investigate further but I suppose it could be wrong for other days also.

Reason
Function ceil instead of floor is used in Julian day calculation formula in function bool dateToJD(...) in the file basic_pro.cpp.

How to reproduce
Execute:
GDL> print, julday(1, 1, 1981, 0)
Expected output:
2444605.5
Actual output:
2444604.5

How to fix
Replace ceil with floor. Diff-file is attached. Also the hack fixing value of variable jd "//for some obscure reason" is not needed anymore. Fixed it also.

1 Attachments

Discussion

  • giloo
    giloo
    2014-02-25

    thanks, I'll implement the patch asap.

     
  • giloo
    giloo
    2014-02-28

    • status: open --> closed-fixed