Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math/big: typo in formula used in comment #28444

Closed
gaufung opened this issue Oct 28, 2018 · 2 comments
Closed

math/big: typo in formula used in comment #28444

gaufung opened this issue Oct 28, 2018 · 2 comments

Comments

@gaufung
Copy link

gaufung commented Oct 28, 2018

Please answer these questions before submitting your issue. Thanks!
At line 85 in src/math/big/arith.go file, it should be q = (u1<<_W + u0 - r)/v rather than q = (u1<<_W + u0 - r)/y

What version of Go are you using (go version)?

go version go1.10.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

What did you see instead?

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/145280 mentions this issue: math/big: fix a formula used as documentation

@ALTree ALTree changed the title comment typo math/big: typo in formula used in comment Oct 28, 2018
@gaufung
Copy link
Author

gaufung commented Oct 28, 2018

@ALTree Thanks a lot

@gaufung gaufung closed this as completed Oct 28, 2018
gopherbot pushed a commit that referenced this issue Oct 28, 2018
The function documentation was wrong, it was using a wrong parameter. This change
replaces it with the right parameter.

The wrong formula was: q = (u1<<_W + u0 - r)/y
The function has got a parameter "v" (of type Word), not a parameter "y".
So, the right formula is: q = (u1<<_W + u0 - r)/v

Fixes #28444

Change-Id: I82e57ba014735a9fdb6262874ddf498754d30d33
Reviewed-on: https://go-review.googlesource.com/c/145280
Reviewed-by: Robert Griesemer <gri@golang.org>
@golang golang locked and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants