Skip to content

math/big: comparison is always true #11277

@tzneal

Description

@tzneal

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions