aliquote.org

May 16, 2025

A leap year check in three instructions. In Racket:

(define (leap-year? x) (<= (bitwise-and (* x 1073750999) 3221352463) 126976))

img

See also this followup post by John Cook.