Commit 291c2329 authored by Andrew Wood's avatar Andrew Wood

Fix count of leap years since 1970

parent 13942f01
Pipeline #2595 failed with stage
in 0 seconds
......@@ -45,7 +45,11 @@ CONTAINS
m = values(6) - values(4)
s = values(7)
days = (year - 1970)*365 + (year - 1969)/4 + days_since_new_year(month)
days = (year - 1970)*365 & ! 365 days per year
+ (year - 1969)/4 & ! and an extra day for each leap year
- (year - 1601)/100 & ! but century years are not leap years
+ (year - 1601)/400 & ! unless divisible by 400
+ days_since_new_year(month)
IF ((MOD(year,400) == 0 &
.OR. (MOD(year,4) == 0 .AND. MOD(year,100) /= 0)) &
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment