Kanbaru 🌟 (one hikari of too many)

(replying to Ridley @ WATCH LYCORECO)

@rcombs perhaps! I'm curious what strategy they use, do they also do (timestamp % 400yearperiod) but then perhaps divide by 365 and do some sort of trick to turn it into a correct integer?

Ridley @ WATCH LYCORECO

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari musl approach: simple, all fairly intelligible numbers; lots of modulo; some explicit branching for edges: github.com/bminor/musl/blob/f5
the libcxx approach: just do a bunch of divides by constants lol github.com/llvm/llvm-project/b

Kanbaru 🌟 (one hikari of too many)

(replying to Ridley @ WATCH LYCORECO)

@rcombs heh, thanks. both pretty elegant in their own ways!