369
submitted 9 months ago by BmeBenji@lemm.ee to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] PowerCrazy@lemmy.ml 1 points 9 months ago

In general integer division is implemented using a form of long division, in binary.

The point of my comment is that division in binary IS bitshifting. There is no other way to do it if you want the real answer. You can estimate, you can round, but the computational method of division is done via bitshifting of binarary expansions of numbers in an ALU.

this post was submitted on 28 Mar 2024
369 points (93.6% liked)

Programmer Humor

32739 readers
627 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS