Post Reply 
(15C) Julian Day to Day of Week [ISO; 12C Formula]
08-26-2016, 01:39 PM (This post was last modified: 08-27-2016 08:24 PM by Nick.)
Post: #1
(15C) Julian Day to Day of Week [ISO; 12C Formula]
Formula: ISO Day of Week = JD MOD 7 + 1
- Same formula as 12C [1 = Monday .. 7 = Sunday]

Input: X = JD (Julian Day)
Output: X = DOW (ISO Day of Week)

Size: 15 Bytes

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

Note: The stack is not preserved.

Enjoy,
Nick

Code:
01 LBL 0
02 ENTER
03 ENTER
04 7
05 /
06 LSTx
07 X<->Y
08 FRAC
09 *
10 1
11 .
12 5
13 +
14 INT
15 RTN

Comments:

14 INT(x + .5) ' Rounding per precision loss during MOD
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(15C) Julian Day to Day of Week [ISO; 12C Formula] - Nick - 08-26-2016 01:39 PM



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