• Robert Griesemer's avatar
    math/big: make Rat.Denom() always return a reference · 07612b8d
    Robert Griesemer authored
    The documentation says so, but in the case of a normalized
    integral Rat, the denominator was a new value. Changed the
    internal representation to use an Int to represent the
    denominator (with the sign ignored), so a reference to it
    can always be returned.
    
    Clarified documentation and added test cases.
    
    Fixes #3521.
    
    R=golang-dev, rsc
    CC=golang-dev
    https://golang.org/cl/6237045
    07612b8d
rat.go 9.94 KB