Housekeeping
This commit is contained in:
parent
affab72624
commit
330dbcbe3a
|
@ -94,24 +94,22 @@ JMP2r
|
|||
NIP NIP
|
||||
|
||||
JMP2r
|
||||
&m 1f 1c 1f 1e 1f 1e 1f 1f 1e 1f 1e 1f
|
||||
&m [ 1f 1c 1f 1e 1f 1e 1f 1f 1e 1f 1e 1f ]
|
||||
|
||||
@is-leap-year ( year* -- bool )
|
||||
|
||||
( leap year if perfectly divisible by 400 )
|
||||
DUP2 #0190 ( MOD2 ) DIV2k MUL2 SUB2 #0000 EQU2 ?&leap
|
||||
( not a leap year if divisible by 100 )
|
||||
( but not divisible by 400 )
|
||||
( not a leap year if divisible by 100, but not divisible by 400 )
|
||||
DUP2 #0064 ( MOD2 ) DIV2k MUL2 SUB2 #0000 EQU2 ?¬-leap
|
||||
( leap year if not divisible by 100 )
|
||||
( but divisible by 4 )
|
||||
DUP2 #0003 AND2 #0000 EQU2 ?&leap
|
||||
( all other years are not leap years )
|
||||
¬-leap
|
||||
POP2 #00
|
||||
|
||||
( leap year if not divisible by 100, but divisible by 4 )
|
||||
#0003 AND2 #0000 EQU2
|
||||
JMP2r
|
||||
¬-leap
|
||||
POP2 #00
|
||||
JMP2r
|
||||
&leap
|
||||
POP2 #01
|
||||
JMP2r
|
||||
&leap POP2 #01 JMP2r
|
||||
|
||||
@print-greg ( doty* year* -- )
|
||||
|
||||
|
|
Loading…
Reference in New Issue