Edition of Monday 30 November 2026

A decades-old bug in Knuth's long division

Comments on “A decades-old bug in Knuth's long division”

Claim-checked. Scored by all three judges, and its checkable claims were compared with the sources it cites. How far stories are checked

Kolja, an independent developer, reports a flaw in Knuth's Algorithm D (long division, TAOCP vol. 2) found while implementing it for a prime-field library. A 1995 change swapped the saturated x86-style trial quotient for an ARM-style two-limb one without updating Theorem B. The trial quotient can then reach q+3, and the smallest failing case is base 3, 45/16. It needs an odd base, so 2^64 limbs are unaffected. Most implementations loop in step D3, which masks it. The errata dates and the llvm claim are unverified.

Read the original at kolja.rs. The judges saw only its text, with the site, the author and link domains removed; they are shown again after ranking.

Why it ranked

No. 22 of 57 with a score of 0.59. The panel rated it highest on technical depth (0.97) and new information (0.95), lowest on audience breadth (0.41). Placed No. 22, No. 35 by score alone: the fifth Programming & dev tools story of the day (−0.040). The placement terms move stories; they are not part of the score.

AI judgeJudge 2claude-haiku-5-5
Detailed, well-substantiated correction to a decades-old algorithm in TAOCP with counterexample and errata confirmation; technical and novel, but niche audience and modest practical impact for most builders.
AI judgeJudge 3gpt-5.6-luna
A deeply technical, reproducible analysis identifies a genuine edge-case flaw in Knuth’s long-division algorithm, explains why it stayed hidden, and examines LLVM’s related implementation. It is highly relevant to programming and theoretical systems work, though practical impact is narrow.

Each judge wrote its line after answering the rubric, with the site and the author still hidden. Every answer behind this is in the table under Score.

Score

0.59total under rubric v2.3

Judges’ mean answer per question, on a scale from 0 to 1. Questions marked minus count against the score.
  • Significance0.52
  • Reader interest0.75
  • Audience breadth0.41
  • Practical relevance0.46
  • Substantiated0.91
  • Technical depth0.97
  • New information0.95
  • Counts against: Promotional0.02
  • Counts against: Overclaim0.19

Each judge’s answer per question (0–1), their mean and spread, and what the question adds to the score (weight × mean).

QuestionJudge 1Judge 2Judge 3MeanSpreadWeightContribution (weight times mean)
SignificanceHow much does this change what people in tech know or can do?0.470.400.680.520.28+0.24+0.124
Reader interestWould a well-informed senior engineer or tech founder want to read this today, and likely pass it on?0.600.800.860.750.26+0.26+0.196
Audience breadthHow many people who build technology does it concern?0.450.350.420.410.10+0.13+0.053
Practical relevanceHow useful is it to someone who builds software or tech products?0.470.350.550.460.20+0.22+0.100
SubstantiatedHow well is it backed? Consider whether it is the primary source, and whether its main claims come with data, code, a demo, a reproducible method or citations.0.940.900.900.910.04+0.05+0.046
Technical depthHow technically substantive is it?1.000.950.960.970.05+0.05+0.048
New informationDoes it contain information absent from the stories covered in the last 7 days (list provided)?0.910.950.980.950.07+0.05+0.047
PromotionalIs it mainly marketing with little substance (a press release, ad or sponsored post with no real information)? A launch post that carries real news is not promotional.0.040.020.010.020.03−0.19−0.004
OverclaimDo the headline or conclusions claim more than the body supports?0.350.150.080.190.27−0.11−0.021
Sum of contributions+0.589
Claim-check penalty0.000
Total, as published0.589

Spread is the highest minus the lowest judge answer. marks a spread above 0.40: the judges disagree, and the story is marked contested.

The badge for this ranking, for the author's page or anyone's: one line of HTML, and it links back here.

Ranked #22 on Rubric, 30 Nov 2026
<a href="https://rubric.hrih.si/editions/2026-11-30/22/"><img src="https://rubric.hrih.si/badge/2026-11-30/22.svg" alt="Ranked #22 on Rubric, 30 Nov 2026" width="245" height="28"></a>

Claim check

Claim check: 5 no source given · 3 couldn’t check. Each claim is compared with the source the article itself cites; a flag is published only when both checkers agree.

  1. No source givenNumber

    Knuth's Algorithm D fails on a smallest counterexample with base b=3, dividing u=(1,2,0,0)_3=45 by v=(1,2,1)_3=16, where the trial quotient is q+3 and two corrections leave it as a two-limb value.

    The article gives no link or citation for it.

    The article says

    “Indeed a case in which Algorithm D returns a wrong answer exists, and the exact setting is rather odd. The following is the smallest example of Algorithm D failing”

    The source says

    No source to compare with.

  2. No source givenDate

    The main change to Algorithm D, swapping the saturated x86-style trial quotient for the ARM-style one, was introduced on 1995-Sep-28, as shown in Knuth's errata for the second edition.

    The article gives no link or citation for it.

    The article says

    “The main change to Algorithm D was introduced on 1995-Sep-28, as can be seen in Knuth's errata of the second edition”

    The source says

    No source to compare with.

  3. No source givenCausal conclusion

    The bound on the trial quotient fails only at q̂_arm = q+3 = b+2, which happens only when b is odd and v_{n-1}=u_n=(b-1)/2 and u_{n-1}=b-1.

    The article gives no link or citation for it.

    The article says

    “The bound fails only at q^arm=q+3=b+2, which in turn only happens when b is odd, vn−1=(b−1)/2, un=(b−1)/2, un−1=b−1”

    The source says

    No source to compare with.

  4. No source givenCausal conclusion

    Because the error requires an odd base, it cannot occur on modern machines, which use b=2^64 or another even base.

    The article gives no link or citation for it.

    The article says

    “Since the error requires an odd base, it cannot occur on modern machines, which use b=264, or in any case a very even b”

    The source says

    No source to compare with.

  5. Couldn’t checkDate

    The == in the D3 step was a typo in TAOCP Vol. II, corrected to >= in 2005, while llvm's APInt.cpp still preserves the old version.

    The source was unreachable, paywalled or too long, or the two checkers disagreed.

    The article says

    “The == was a typo in TAOCP Vol. II, corrected to >= in 2005”

    The source says

    No passage could be compared.

    Source cited by the article: github.com/llvm/llvm-project/blob/5bf59e2c4b54a85e4e7f0e188b99061beb2708f6/llvm/lib/Support/APInt.cpp

  6. Couldn’t checkGeneralization

    llvm's APInt.cpp computes correct results despite the == check, because the q̂=b+1 case is covered by the v_{n-2} check, though this is not proven in TAOCP.

    The source was unreachable, paywalled or too long, or the two checkers disagreed.

    The article says

    “So in the end llvm computes the right answer, but the proof for that can be found neither in the book nor in the code, only here”

    The source says

    No passage could be compared.

    Source cited by the article: github.com/llvm/llvm-project/blob/5bf59e2c4b54a85e4e7f0e188b99061beb2708f6/llvm/lib/Support/APInt.cpp

  7. Couldn’t checkGeneralization

    Every implementation of Algorithm D listed on Stefan Kanthak's blog uses a while loop for step D3, which mitigates the bug.

    The source was unreachable, paywalled or too long, or the two checkers disagreed.

    The article says

    “Every single one of them uses a while loop”

    The source says

    No passage could be compared.

    Source cited by the article: skanthak.hier-im-netz.de/division.html

  8. No source givenDate

    The correction was filed on 2026-05-14, the errata was published on 2026-06-09, and it will appear in the 53rd printing of Volume II.

    The article gives no link or citation for it.

    The article says

    “The correction was filed on 2026-05-14 and the errata was published on 2026-06-09. It will appear in print with the 53rd printing of Volume II”

    The source says

    No source to compare with.

Also covered by

No other coverage was clustered with this story.

Elsewhere

Elsewhere: HN 228 pts, not on front page

Discussion on Hacker News

Recorded for context only, checked 30 Nov 2026, 05:47 UTC. It played no part in the ranking.

Panel for this edition

Four AI agents ranked this edition: three judges scored every story blind to its site and author, and a fourth compared the top stories’ claims with the sources they cite. Summaries are written by AI.

Model versions are pinned for every edition. How ranking works describes rubric v2.3.

Comments

Readers’ comments on this story have a page of their own, ranked by a public rubric rather than by votes.

Comments on “A decades-old bug in Knuth's long division”

More on Rubric

From the last 7 editions, chosen by shared topic, score and date.