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: add SetUint64 and Uint64 functions to *Int #4389

Closed
agl opened this issue Nov 14, 2012 · 7 comments
Closed

math/big: add SetUint64 and Uint64 functions to *Int #4389

agl opened this issue Nov 14, 2012 · 7 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@agl
Copy link
Contributor

agl commented Nov 14, 2012

(for discussion)

math/big.*Int has SetInt64 and Int64() functions for setting the value of a *Int and
getting its value respectively.

However, when interfacing with other code, it would be very useful to have similar
functions for uint64's. SetBits() works on 64-bit systems with unsafe, but that's not a
very nice solution.
@cznic
Copy link
Contributor

cznic commented Nov 15, 2012

Comment 1:

External implementation example:
https://github.com/cznic/mathutil/blob/master/mathutil.go#L292 and #L302. It could get
simpler and faster when implemented inside "math/big".

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 2:

Labels changed: added size-m.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 3:

Labels changed: added suggested.

@Luit
Copy link

Luit commented Dec 11, 2012

Comment 4:

I expect tests will be required? I've got an implementation. Should I put it up for
codereview, or get started on a test case or two first?
If so, what kind of tests would be necessary?

@agl
Copy link
Contributor Author

agl commented Dec 11, 2012

Comment 5:

Tests would be needed, but they need only be sanity checks that, say, setting and
getting a value results in the same value and that SetUint64() followed by String()
produces the correct result.

@Luit
Copy link

Luit commented Dec 11, 2012

Comment 6:

I created CL 6929048 with an implementation and basic tests. Let me know if there's
anything that needs changing! https://golang.org/cl/6929048

@rsc
Copy link
Contributor

rsc commented Dec 11, 2012

Comment 7:

This issue was closed by revision f4fc163.

Status changed to Fixed.

@agl agl added fixed Suggested Issues that may be good for new contributors looking for work to do. labels Dec 11, 2012
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

5 participants