math/big: comment typo #68466
Labels
Documentation
Issues describing a change to documentation.
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Go version
go version go1.22.5 windows/amd64
Output of
go env
in your module/workspace:What did you do?
I read the Go source code of big integer division algorithm, and found a typo in comment.
What did you see happen?
In file go\src\math\big\natdiv.go
There is a mistake in line 395:
> -y₁·S / y [x₀ < S, so S - x₀ < 0; drop it]
What did you expect to see?
x₀ < S, so the x₀ is smaller than the S, and S - x₀ must be positive.
So the comment should be:
> -y₁·S / y [x₀ < S, so S - x₀ > 0; drop it]
Subsequent proofs are based on S - x₀ > 0, so there are no more mistake in subsequent proofs, and it should be a typo.
The text was updated successfully, but these errors were encountered: