def from_jd(jd):
jd = trunc(jd) + <NUM_LIT:0.5><EOL>year = trunc(((<NUM_LIT:30> * (jd - EPOCH)) + <NUM_LIT>) / <NUM_LIT>)<EOL>month = min(<NUM_LIT:12>, ceil((jd - (<NUM_LIT> + to_jd(year, <NUM_LIT:1>, <NUM_LIT:1>))) / <NUM_LIT>) + <NUM_LIT:1>)<EOL>day = int(jd - to_jd(year, month, <NUM_LIT:1>)) + <NUM_LIT:1><EOL>return (year, month, day)<EOL>
Calculate Islamic date from Julian day