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

proposal: Go 2: allow signed shift counts also for big.Int #29051

Closed
TuomLarsen opened this issue Dec 1, 2018 · 1 comment
Closed

proposal: Go 2: allow signed shift counts also for big.Int #29051

TuomLarsen opened this issue Dec 1, 2018 · 1 comment
Labels
FrozenDueToAge Proposal v2 A language change or incompatible library change
Milestone

Comments

@TuomLarsen
Copy link

Considering #19113, perhaps it would be good idea to extend the usage of signed shift counts from machine integers to big.Ints (Lsh, Rsh) as well.

That is, func (z *Int) Lsh(x *Int, n uint) *Intfunc (z *Int) Lsh(x *Int, n int) *Int.

@gopherbot gopherbot added this to the Proposal milestone Dec 1, 2018
@andybons andybons added the v2 A language change or incompatible library change label Dec 5, 2018
@andybons andybons changed the title proposal: allow signed shift counts also for big.Int proposal: Go 2: allow signed shift counts also for big.Int Dec 5, 2018
@ianlancetaylor
Copy link
Contributor

The proposal language change for permitting signed shift counts would not break any working programs. This change, though, would. While there is a small benefit here, there is also a cost. Thanks, but this doesn't seem worth doing. If this is a problem in your program, it's straightforward to write a tiny wrapper that accepts int; that is not easy to do for the << or >> operators.

@golang golang locked and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Proposal v2 A language change or incompatible library change
Projects
None yet
Development

No branches or pull requests

4 participants