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

Comments

Projects
None yet
4 participants
@TuomLarsen
Copy link

TuomLarsen commented Dec 1, 2018

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

@gopherbot gopherbot added the Proposal label Dec 1, 2018

@andybons andybons added the Go2 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

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented Dec 18, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment