Skip to content

Conversation

@lmittmann
Copy link

@lmittmann lmittmann commented Aug 7, 2019

Adding a sample implementation for big.Int methods Inc() and Dec(). #29951

Incrementing and decrementing big.Int's by one can be done with less comparisons and allocations opposed to x.Add(x, one) and x.Sub(x, one).

Benchmark results:

goos: linux
goarch: amd64
pkg: math/big
BenchmarkInc-4         70917309                16.6 ns/op
BenchmarkIncByAdd-4    55380994                18.7 ns/op
goos: linux
goarch: amd64
pkg: math/big
BenchmarkDec-4         63753597                17.3 ns/op
BenchmarkDecBySub-4    57247021                21.3 ns/op

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no Used by googlebot to label PRs as having an invalid CLA. The text of this label should not change. label Aug 7, 2019
@mvdan
Copy link
Member

mvdan commented Aug 28, 2019

The CLA was never signed, and this needs an issue to propose the API changes first. Closing for now.

@mvdan mvdan closed this Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: no Used by googlebot to label PRs as having an invalid CLA. The text of this label should not change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants