Jump to content

Day of the week: Difference between revisions

m
review RPL comments
m (review RPL comments)
Line 5,036:
 
=={{header|RPL}}==
Early RPL doesversions do not have any date library, so a specific instruction implementsimplement Zeller's congruence with a stack-oriented algorithm.
{{works with|Halcyon Calc|4.2.7}}
'''IF''' OVER 2 ≤ '''THEN''' 1 - SWAP 12 + SWAP '''END'''
100 MOD LAST / IP FLOOR
DUP 4 / IPFLOOR SWAP DUP + - SWAP DUP 4 / IPFLOOR + +
SWAP 1 + 13 * 5 / IPFLOOR + +
7 MOD 5 + 7 MOD 1 +
≫ ''''WKDAY'''' STO
'WKDAY' STO
 
≪ { } 2008 2121 '''FOR''' year
'''IF''' 25 12 year '''WKDAY''' 7 == '''THEN''' year + '''END NEXT'''
2008 2121 FOR year
EVAL
IF 25 12 year WKDAY 7 == THEN year + END
NEXT
EVAL
{{out}}
<pre>
1,151

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.