Frank <frank.breitl...@gmx.de> added the comment: Here an example where the signum function provides an elegant way to calculate the Julian date:
def julian_date(YY,MM,DD,HR,Min,Sec,UTcor): return 367*YY - (7*(YY+((MM+9)/12))/4) + (275*MM/9)+ DD + 1721013.5 + UTcor/24 - 0.5*sign((100*YY)+MM-190002.5) + 0.5 + HR/24.0 + Min/(60.0*24.0) + Sec/(3600.0*24.0) http://aa.usno.navy.mil/faq/docs/JD_Formula.php http://www.krioma.net/blog/2011/09/python_julian_date.php By the way Julian date should be part of the time or datetime module. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue829370> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com