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

Issue 5543047: code review 5543047: math/big: add examples for Rat and Int's SetString and ... (Closed)

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

Description

math/big: add examples for Rat and Int's SetString and Scan methods

Patch Set 1 #

Patch Set 2 : diff -r d33a0a5fcdc0 https://go.googlecode.com/hg #

Patch Set 3 : diff -r d33a0a5fcdc0 https://go.googlecode.com/hg #

Total comments: 1

Patch Set 4 : diff -r f10dfb8fa0eb https://go.googlecode.com/hg #

Total comments: 6

Patch Set 5 : diff -r c0d32b240d3d https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -0 lines) Patch
A src/pkg/math/big/example_test.go View 1 2 3 4 1 chunk +51 lines, -0 lines 0 comments Download

Messages

Total messages: 12
adg
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg
13 years, 9 months ago (2012-01-12 22:47:33 UTC) #1
bradfitz
LGTM On Thu, Jan 12, 2012 at 2:47 PM, <adg@golang.org> wrote: > Reviewers: golang-dev_googlegroups.com, > ...
13 years, 9 months ago (2012-01-12 22:49:03 UTC) #2
rsc
Why use such ridiculous numbers?
13 years, 9 months ago (2012-01-12 22:50:00 UTC) #3
adg
On 13 January 2012 09:50, Russ Cox <rsc@golang.org> wrote: > Why use such ridiculous numbers? ...
13 years, 9 months ago (2012-01-12 23:01:45 UTC) #4
r2
On Jan 12, 2012, at 3:01 PM, Andrew Gerrand wrote: > On 13 January 2012 ...
13 years, 9 months ago (2012-01-12 23:02:40 UTC) #5
adg
Hello golang-dev@googlegroups.com, bradfitz@golang.org, rsc@golang.org, r@google.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 9 months ago (2012-01-12 23:04:26 UTC) #6
adg
Also added an example for Rat.
13 years, 9 months ago (2012-01-12 23:05:57 UTC) #7
gri
http://codereview.appspot.com/5543047/diff/4003/src/pkg/math/big/example_test.go File src/pkg/math/big/example_test.go (right): http://codereview.appspot.com/5543047/diff/4003/src/pkg/math/big/example_test.go#newcode14 src/pkg/math/big/example_test.go:14: // Calculate the square root of x using Newton's ...
13 years, 9 months ago (2012-01-12 23:09:09 UTC) #8
adg
Hello golang-dev@googlegroups.com, bradfitz@golang.org, rsc@golang.org, r@google.com, gri@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 9 months ago (2012-01-24 05:33:59 UTC) #9
r
LGTM but wait for others http://codereview.appspot.com/5543047/diff/8001/src/pkg/math/big/example_test.go File src/pkg/math/big/example_test.go (right): http://codereview.appspot.com/5543047/diff/8001/src/pkg/math/big/example_test.go#newcode32 src/pkg/math/big/example_test.go:32: fmt.Println(r, err) use idiomatic ...
13 years, 9 months ago (2012-01-24 15:44:17 UTC) #10
gri
LGTM http://codereview.appspot.com/5543047/diff/8001/src/pkg/math/big/example_test.go File src/pkg/math/big/example_test.go (right): http://codereview.appspot.com/5543047/diff/8001/src/pkg/math/big/example_test.go#newcode31 src/pkg/math/big/example_test.go:31: _, err := fmt.Sscan("1.5000", r) make this 3.142 ...
13 years, 9 months ago (2012-01-24 17:33:16 UTC) #11
adg
13 years, 9 months ago (2012-01-24 23:29:55 UTC) #12
*** Submitted as http://code.google.com/p/go/source/detail?r=60013c96035b ***

math/big: add examples for Rat and Int's SetString and Scan methods

R=golang-dev, bradfitz, rsc, r, gri, r
CC=golang-dev
http://codereview.appspot.com/5543047

http://codereview.appspot.com/5543047/diff/8001/src/pkg/math/big/example_test.go
File src/pkg/math/big/example_test.go (right):

http://codereview.appspot.com/5543047/diff/8001/src/pkg/math/big/example_test...
src/pkg/math/big/example_test.go:31: _, err := fmt.Sscan("1.5000", r)
On 2012/01/24 17:33:17, gri wrote:
> make this 3.142 and then the printed fraction should be 355/113 like above.
more
> interesting than 1.5

355/133 isn't exactly 3.142, so that won't work.

http://codereview.appspot.com/5543047/diff/8001/src/pkg/math/big/example_test...
src/pkg/math/big/example_test.go:32: fmt.Println(r, err)
On 2012/01/24 15:44:18, r wrote:
> use idiomatic code
> 
> if err == nil {
>   fmt.Println("error scanning value:", err)
> } else {
>   fmt.Println(r)
> }

Done.

http://codereview.appspot.com/5543047/diff/8001/src/pkg/math/big/example_test...
src/pkg/math/big/example_test.go:41: fmt.Println(i, err)
On 2012/01/24 15:44:18, r wrote:
> ditto

Done.
Sign in to reply to this message.

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