mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
512fffdac8
The udiv function had two buggy modifications to Knuth's Algorithm D: 1. A "three-limb pre-adjustment" that only decremented qhat once 2. A "3-limb refinement" loop with incorrect carry handling These caused incorrect quotients for certain decimal divisions like 10^52 / 10^26. Restored standard Knuth Algorithm D which uses only 2-limb qhat refinement with correction via subtract and add-back. Co-authored-by: Claude <noreply@anthropic.com>