Skip to content

Comment on A decades-old bug in Knuth's long division (TAOCP Vol II, Algorithm 4.3.1D)

Comments

Back in the 1980s, before there was a DIV instruction, I implemented integer division.

I used the same long division algorithm I was taught in 3rd grade, except in binary rather than base 10. Shift and subtract.

It was also the basis for implementing FDIV (floating point division) for those who did not have an x87 chip.

Nobody ever reported a bug in it.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.