Thread with 12 posts

jump to expanded post
Ridley @ WATCH LYCORECO , @rcombs@treehouse.systems
(open profile)

@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

Open remote post (opens in a new window)

@saagar I did actually do a bit of research for this… I went to the Wikipedia page for the Gregorian calendar to check I remembered the leap year algorithm correctly, how long its cycles are, and also to remind me how long each month of the year is…

but the constants I ended up using can be trivially derived from things most people know (how long is a year, what is a leap year, how long is an hour, how long is a day)

Open thread at this post