Last active
September 23, 2018 10:27
-
-
Save roine/a03c93bb43511d0a82d253a5d58b6f65 to your computer and use it in GitHub Desktop.
Efficient (but less readable) checking if Leap Year. sample: https://ellie-app.com/3qN2Njbf2VWa1, source: https://stackoverflow.com/a/11595914/966187
This file contains hidden or 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
isLeapYear : Int -> Bool | |
isLeapYear year = | |
Bitwise.and year 3 == 0 && (not (modBy year 25 == 0) || Bitwise.and year 15 == 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment