Last active
May 18, 2025 09:11
-
-
Save scriptingstudio/4cf8ab1b671ed81424907b8fd32bccf0 to your computer and use it in GitHub Desktop.
Test leap year in one line
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
| # But [datetime]::IsLeapYear is faster anyway | |
| function Test-IsLeap ([uint32]$year) { | |
| (($year * 1073750999) -band 3221352463) -le 126976 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment