Rat.Denom() and Num() work differently, Denom appears to return a copy and Num a pointer · Issue #3521 · golang/go · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
by gnurizen:
The text was updated successfully, but these errors were encountered: