8000 Rat.Denom() and Num() work differently, Denom appears to return a copy and Num a pointer · Issue #3521 · golang/go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Rat.Denom() and Num() work differently, Denom appears to return a copy and Num a pointer #3521

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

Closed
gopherbot opened this issue Apr 13, 2012 · 4 comments

Comments

@gopherbot
Copy link
Contributor

by gnurizen:

Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:

Run "go version" and compare against
http://golang.org/doc/devel/release.html  If a newer version of Go exists,
install it and retry what you did to reproduce the problem.

Thanks.

What steps will reproduce the problem?

http://play.golang.org/p/P7r1ZasEJ2

What is the expected output?

120/100

What do you see instead?

120/1

Which compiler are you using (5g, 6g, 8g, gccgo)?

go run

Which operating system are you using?

OS X

Which version are you using?  (run 'go version')

go version go1

Please provide any additional information below.
@gopherbot
Copy link
Contributor Author

Comment 1 by gnurizen:

Since Denom returns an Int* and the denominator is a stored as a nat I suspect its a doc
bug (ie docs should say it returns a copy).   Or Denom should be changed to return a
nat*, but nat isn't an exported type.   Workaround is to just use SetFrac.

@griesemer
Copy link
Contributor

Comment 2:

See CL 6237045.

Labels changed: added priority-soon, removed priority-triage.

Status changed to Started.

@griesemer
Copy link
Contributor

Comment 3:

Owner changed to @griesemer.

@griesemer
Copy link
Contributor

Comment 4:

This issue was closed by revision 07612b8.

Status changed to Fixed.

@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.
Projects
None yet
Development

No branches or pull requests

2 participants
0