def from_jd(jd):
d = jd - EPOCH<EOL>baktun = trunc(d / <NUM_LIT>)<EOL>d = (d % <NUM_LIT>)<EOL>katun = trunc(d / <NUM_LIT>)<EOL>d = (d % <NUM_LIT>)<EOL>tun = trunc(d / <NUM_LIT>)<EOL>d = (d % <NUM_LIT>)<EOL>uinal = trunc(d / <NUM_LIT:20>)<EOL>kin = int((d % <NUM_LIT:20>))<EOL>return (baktun, katun, tun, uinal, kin)<EOL>
Calculate Mayan long count from Julian day