Fix countLeapYears

This commit is contained in:
Oscar Nihlgård 2017-10-10 15:47:12 +02:00
commit f2ba3d174c
2 changed files with 7 additions and 1 deletions

View file

@ -1025,7 +1025,7 @@ proc countLeapYears*(yearSpan: int): int =
## counts the number of leap years up to January 1st of a given year.
## Keep in mind that if specified year is a leap year, the leap day
## has not happened before January 1st of that year.
(((yearSpan - 1) / 4) - ((yearSpan - 1) / 100) + ((yearSpan - 1) / 400)).int
(yearSpan - 1) div 4 - (yearSpan - 1) div 100 + (yearSpan - 1) div 400
proc countDays*(yearSpan: int): int =
## Returns the number of days spanned by a given number of years.