Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change.
LGTM thanks. - gri On Mon, Dec 27, 2010 at 4:38 AM, <snilsson@nada.kth.se> wrote: > Reviewers: golang-dev_googlegroups.com, > > Message: > Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), > > I'd like you to review this change. > > > Description: > atof: added 'E' as valid token for exponent > > Please review this at http://codereview.appspot.com/3827042/ > > Affected files: > M src/pkg/strconv/atof.go > M src/pkg/strconv/atof_test.go > > > Index: src/pkg/strconv/atof.go > =================================================================== > --- a/src/pkg/strconv/atof.go > +++ b/src/pkg/strconv/atof.go > @@ -107,7 +107,7 @@ > // just be sure to move the decimal point by > // a lot (say, 100000). it doesn't matter if it's > // not the exact number. > - if i < len(s) && s[i] == 'e' { > + if i < len(s) && (s[i] == 'e' || s[i] == 'E') { > i++ > if i >= len(s) { > return > Index: src/pkg/strconv/atof_test.go > =================================================================== > --- a/src/pkg/strconv/atof_test.go > +++ b/src/pkg/strconv/atof_test.go > @@ -24,6 +24,7 @@ > {"1x", "0", os.EINVAL}, > {"1.1.", "0", os.EINVAL}, > {"1e23", "1e+23", nil}, > + {"1E23", "1e+23", nil}, > {"100000000000000000000000", "1e+23", nil}, > {"1e-100", "1e-100", nil}, > {"123456700", "1.234567e+08", nil}, > > >
*** Submitted as http://code.google.com/p/go/source/detail?r=fac46b340ec9 *** atof: added 'E' as valid token for exponent R=golang-dev, gri CC=golang-dev http://codereview.appspot.com/3827042 Committer: Robert Griesemer <gri@golang.org>