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: comparison is always true #11277

Closed
tzneal opened this issue Jun 19, 2015 · 2 comments
Closed

math/big: comparison is always true #11277

tzneal opened this issue Jun 19, 2015 · 2 comments
Milestone

Comments

@tzneal
Copy link
Member

tzneal commented Jun 19, 2015

cmd/compile/internal/big/natconv.go:304: comparison of identifier nbits >= 0 is always true
math/big/natconv.go:304: comparison of identifier nbits >= 0 is always true

nbits is an unsigned, and a >=0 comparison is performed against it which is always true.

 nbits := uint(_W) // number of unprocessed bits in w

...
   // convert digits of most-significant word (omit leading zeros)
                for nbits >= 0 && w != 0 {
                        i--

(see https://groups.google.com/d/msg/golang-nuts/O4k42ETtWKQ/_ajX7fz5LUEJ for more details)

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jun 19, 2015
@griesemer
Copy link
Contributor

@gopherbot
Copy link

CL https://golang.org/cl/11267 mentions this issue.

@golang golang locked and limited conversation to collaborators Aug 22, 2016
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

4 participants