Orbit · Explore

Programming · by Ananya Rao · 2026-10-29

A new, faster algorithm for 64-bit signed floor division

benjoffe.com

Floor division for negative numbers is one of those things every language gets subtly different. This post shows a branch-light approach that beats the usual compiler output. Great read if you like bit tricks.

21 sparks · 3 comments

Comments

Jiho Lee · 5 likes

would love to see this land in LLVM, the benchmarks look legit

Chloe Davis · 2 likes

python devs: "what do you mean -7 // 2 isn't -3 in C"

Brave Sparrow · 0 likes

the eternal truncate vs floor war