Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(68)

Issue 6237045: code review 6237045: math/big: make Rat.Denom() always return a reference (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by gri
Modified:
12 years, 9 months ago
Reviewers:
CC:
golang-dev, rsc
Visibility:
Public.

Description

math/big: make Rat.Denom() always return a reference 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 issue 3521.

Patch Set 1 #

Patch Set 2 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 3 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 4 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 5 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 6 : diff -r 3b320ce16e39 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -45 lines) Patch
M src/pkg/math/big/rat.go View 1 16 chunks +53 lines, -45 lines 0 comments Download
M src/pkg/math/big/rat_test.go View 1 2 3 4 1 chunk +53 lines, -0 lines 0 comments Download

Messages

Total messages: 3
gri
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
12 years, 9 months ago (2012-05-23 22:41:35 UTC) #1
rsc
LGTM
12 years, 9 months ago (2012-05-24 15:34:37 UTC) #2
gri
12 years, 9 months ago (2012-05-24 17:49:46 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=fc0c9f4f74b6 ***

math/big: make Rat.Denom() always return a reference

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 issue 3521.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6237045
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b