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

Delta Between Two Patch Sets: src/pkg/strconv/atof.go

Issue 5434095: code review 5434095: strconv: new API (Closed)
Left Patch Set: diff -r 73b9e4cb1afe https://go.googlecode.com/hg/ Created 13 years, 3 months ago
Right Patch Set: diff -r 23c65e5ae3ed https://go.googlecode.com/hg/ Created 13 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/strconv/atob_test.go ('k') | src/pkg/strconv/atof_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Package strconv implements conversions to and from string representations 5 // Package strconv implements conversions to and from string representations
6 // of basic data types. 6 // of basic data types.
7 package strconv 7 package strconv
8 8
9 // decimal to binary floating point conversion. 9 // decimal to binary floating point conversion.
10 // Algorithm: 10 // Algorithm:
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // If s is not syntactically well-formed, ParseFloat returns err.Error = ErrSynt ax. 397 // If s is not syntactically well-formed, ParseFloat returns err.Error = ErrSynt ax.
398 // 398 //
399 // If s is syntactically well-formed but is more than 1/2 ULP 399 // If s is syntactically well-formed but is more than 1/2 ULP
400 // away from the largest floating point number of the given size, 400 // away from the largest floating point number of the given size,
401 // ParseFloat returns f = ±Inf, err.Error = ErrRange. 401 // ParseFloat returns f = ±Inf, err.Error = ErrRange.
402 func ParseFloat(s string, bitSize int) (f float64, err error) { 402 func ParseFloat(s string, bitSize int) (f float64, err error) {
403 if bitSize == 32 { 403 if bitSize == 32 {
404 f1, err1 := atof32(s) 404 f1, err1 := atof32(s)
405 return float64(f1), err1 405 return float64(f1), err1
406 } 406 }
407 » f1, err1 := atof64(s) 407 » return atof64(s)
408 » return f1, err1 408 }
409 }
LEFTRIGHT

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