Comment

Comment by captaincrunch

This is fast, READABLE, and accurate:

bool is_leap_year(uint32_t y) { // Works for Gregorian years in range [0, 65535] return ((!(y & 3)) && ((y % 25 != 0) || !(y & 15))); }

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton