by User23 · 1y ago · 0 comments
36: 14930352 (1.2s)
37: 24157817 (2.0s)
38: 39088169 (3.2s)
39: 63245986 (5.2s)
40: 102334155 (8.3s)
41: 165580141 (13.5s)
42: 267914296 (21.8s)
What a familiar pattern in those runtimes!On the other hand, if someone had asked me for an estimate on the run time, I probably would have tried breaking out the master theorem instead of thinking of this, so I don't want to downplay the observation.
https://news.ycombinator.com/item?id=14331627
floor(x + 0.5) wants to be round(x), that function having been introduced in C99. Just remnants of old school C coding.