05-10-2017, 06:17 PM (This post was last modified: 05-10-2017 09:13 PM by Dieter.)
Post: #10
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
(05-10-2017 05:12 PM)Vtile Wrote:  Heh. It definedly is easy when one knows what he is doing. Superb post Dieter, many thanks. I'll take a closer look at it tomorrow, as I have already spend too much time today reading about the calendar system(s).

Thank you very much. With just a few additional steps the program should even work for any valid Gregorian date (i.e. since 15 Oct 1582) that does not cause roundoff errors when Y is multiplied by 365,25 – but well, I did not test any year. ;-)

Code:
... ... 031 INT 032 + 033 RCL 0 034 EEX 035 2 036 / 037 INT 038 - 039 LstX 040 4 041 / 042 INT 043 + 044 RTN

Example:
31 [ENTER] 12 [ENTER] 9999  f [D] => 3652487
15 [ENTER] 10 [ENTER] 1582  f [D] =>  578164
[–] => 3074323 days

Dieter

Edit: changed first steps of the code to reflect edited version of original program.
 « Next Oldest | Next Newest »