(15C) MM.DDYYYY or DD.MMYYYY to Julian Day [Stack-Only] - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (15C) MM.DDYYYY or DD.MMYYYY to Julian Day [Stack-Only] (/thread-6729.html) |
(15C) MM.DDYYYY or DD.MMYYYY to Julian Day [Stack-Only] - Nick - 08-26-2016 04:08 AM Formula: http://www.cs.utsa.edu/~cs1063/projects/Spring2011/Project1/jdn-explanation.html Input: X = MM.DDYYYY (Date) Output: X = JD (Julian Day) Size: 87 Bytes Related to: (15C) Julian Day to Day of Week Related to: (15C) Delta Days Note: This design requires no temp registers and does not preserve the stack. Enjoy, Nick Code: 01 LBL 0 For DD.MMYYYY, insert the following between steps 7 and 8: Code: 7.1 INT Comments: 08 M; DD.YYYY ' Month (Day and Year stored together) 17 a; M; D.Y ' Expression: a 26 m; D.Y; a; a ' Expression: m 35 JD; D.Y; a; a ' Accumulator: JD 40 D; JD; a; .Y ' Day 46 Y; a; JD ' Year 53 y; JD ' Expression: y 57 j; JD; j; j ' Expression: j positioned for constant operation 72 EEX 2 / instead of 1% per accumulator operation 86 JD ' Result |