Post Reply 
(15C) Delta Days [12C Actual Day Basis]
08-27-2016, 08:14 PM (This post was last modified: 08-27-2016 10:58 PM by Nick.)
Post: #1
(15C) Delta Days [12C Actual Day Basis]
Formula: Delta Days = D2 - D1 (Actual Day Basis; 365-366 Days / Year)
- Note: Unlike the 12C formula, the 360 Basis result is not returned in Y. Instead, Z is copied to Y and T is copied to Z preserving stack and constant operation.

Input: X = D2 (Date To) ; Y = D1 (Date From)
Output: X = Delta Days (Number of Days Between Dates)

Requires: (15C) MM.DDYYYY or DD.MMYYYY to Julian Day [Stack-Only]

Note: If you are only interested in Delta Days and do not require the standard Julian Day, you can conserve memory (and improve performance) by using a modified Julian Day, discarding lines 81 - 86.


Enjoy,
Nick

Code:
01 LBL 01
02 STO .4
03 Rup
04 STO .7
05 Rup
06 STO .6
07 Rup
08 GSB 00
09 STO .5
10 RCL .4
11 GSB 00
12 RCL- .5
13 RCL .4
14 ABS
15 CLx
16 RCL .7
17 RCL .7
18 RCL .6
19 Rup
20 RTN

Comments:

- Replace Steps 8 and 11 with your label for the Julian Day function.
- Temp: R.4 (X); R.5 (D1.JD); R.6 (Z); R.7 (T)
- Steps 13 - 15 set LSTx to D2
- Steps 16 - 19 restore the stack and copy the constant
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)