Hacker News new | ask | show | jobs
by dmitrygr 3474 days ago
This is how we've been doing division by a constant in the embedded world since...forever

this is so well known in fact that arm gcc defaults to this when a proper constant exists if you do division or modulus operator...

1 comments

I was going to say, this is an ancient and well-known optimization. I have no idea how old it is, but I would venture it's been a regular practice for at least two decades.