Skip to content

Instantly share code, notes, and snippets.

@banhbaochi3n
Created May 16, 2025 09:47
Show Gist options
  • Save banhbaochi3n/fb119896714285489447ab2865a7c565 to your computer and use it in GitHub Desktop.
Save banhbaochi3n/fb119896714285489447ab2865a7c565 to your computer and use it in GitHub Desktop.
bool is_leap_year_fast(uint32_t y) {
return ((y * 1073750999) & 3221352463) <= 126976;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment