Created
June 30, 2013 00:21
-
-
Save tarynsauer/5893240 to your computer and use it in GitHub Desktop.
Detecting leap years
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def leap_year?(year) | |
year % 400 == 0 || (year % 4 == 0 && year % 100 != 0) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment