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

Issue 99420048: code review 99420048: fmt: fix floating-point padding once and for all (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 11 months ago by r
Modified:
9 years, 11 months ago
Reviewers:
jscrockett01, rsc
CC:
rsc, jscrockett01, golang-codereviews
Visibility:
Public.

Description

fmt: fix floating-point padding once and for all Rewrite formatFloat to be much simpler and clearer and avoid the tricky interaction with padding. The issue refers to complex but the problem is just floating-point. The new tests added were incorrectly formatted before this fix. Fixes issue 8064.

Patch Set 1 #

Total comments: 1

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

Total comments: 1

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -31 lines) Patch
M src/pkg/fmt/fmt_test.go View 1 2 chunks +12 lines, -0 lines 0 comments Download
M src/pkg/fmt/format.go View 1 2 2 chunks +31 lines, -31 lines 0 comments Download

Messages

Total messages: 7
r
Hello rsc (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
9 years, 11 months ago (2014-05-21 17:43:58 UTC) #1
jscrockett01
Is there still a width issue? https://codereview.appspot.com/99420048/diff/1/src/pkg/fmt/fmt_test.go File src/pkg/fmt/fmt_test.go (right): https://codereview.appspot.com/99420048/diff/1/src/pkg/fmt/fmt_test.go#newcode558 src/pkg/fmt/fmt_test.go:558: {"%+010.2f", -104.66 - ...
9 years, 11 months ago (2014-05-21 17:52:56 UTC) #2
r
Hello rsc@golang.org, jscrockett01@gmail.com (cc: golang-codereviews@googlegroups.com), Please take another look.
9 years, 11 months ago (2014-05-21 17:57:59 UTC) #3
jscrockett01
LGTM Thanks.
9 years, 11 months ago (2014-05-21 18:00:40 UTC) #4
rsc
LGTM https://codereview.appspot.com/99420048/diff/20001/src/pkg/fmt/format.go File src/pkg/fmt/format.go (right): https://codereview.appspot.com/99420048/diff/20001/src/pkg/fmt/format.go#newcode366 src/pkg/fmt/format.go:366: sign := byte('+') I found it confusing to ...
9 years, 11 months ago (2014-05-21 18:44:41 UTC) #5
r
almost - you need to check for num[0]=='+' as well, because Inf does that.
9 years, 11 months ago (2014-05-21 19:30:17 UTC) #6
r
9 years, 11 months ago (2014-05-21 19:30:46 UTC) #7
*** Submitted as https://code.google.com/p/go/source/detail?r=e8b79e17dc85 ***

fmt: fix floating-point padding once and for all
Rewrite formatFloat to be much simpler and clearer and
avoid the tricky interaction with padding.
The issue refers to complex but the problem is just floating-point.
The new tests added were incorrectly formatted before this fix.
Fixes issue 8064.

LGTM=jscrockett01, rsc
R=rsc, jscrockett01
CC=golang-codereviews
https://codereview.appspot.com/99420048
Sign in to reply to this message.

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