aboutsummaryrefslogtreecommitdiff
path: root/src/math/big/floatconv.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2015-03-03 14:17:39 -0800
committerRobert Griesemer <gri@golang.org>2015-03-04 18:24:34 +0000
commit2a1728d0094f0ffc66231ec415522bf54ca37293 (patch)
treedb38140b82a03b92f17dc4c7923c9faec13340d8 /src/math/big/floatconv.go
parent0a8a62584870ef5b4eeea0f520d94d95235e4070 (diff)
downloadgo-2a1728d0094f0ffc66231ec415522bf54ca37293.tar.xz
math/big: use stringer for enum String() methods
Change-Id: Ide0615542d67b7d81bf6c56aab550e142a8789f7 Reviewed-on: https://go-review.googlesource.com/6682 Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/math/big/floatconv.go')
-rw-r--r--src/math/big/floatconv.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/math/big/floatconv.go b/src/math/big/floatconv.go
index 31e192f5b4..23cf948a02 100644
--- a/src/math/big/floatconv.go
+++ b/src/math/big/floatconv.go
@@ -63,7 +63,7 @@ func (z *Float) SetString(s string) (*Float, bool) {
// be binary, if present (an "e" or "E" exponent indicator cannot be
// distinguished from a mantissa digit).
//
-// BUG(gri) This signature conflicts with Scan(s fmt.ScanState, ch rune) error.
+// BUG(gri) The Float.Scan signature conflicts with Scan(s fmt.ScanState, ch rune) error.
func (z *Float) Scan(r io.ByteScanner, base int) (f *Float, b int, err error) {
if z.prec == 0 {
z.prec = 64
@@ -224,7 +224,7 @@ func ParseFloat(s string, base int, prec uint, mode RoundingMode) (f *Float, b i
// number of digits necessary such that ParseFloat will return f exactly.
// The prec value is ignored for the 'b' or 'p' format.
//
-// BUG(gri) Currently, Format does not accept negative precisions.
+// BUG(gri) Float.Format does not accept negative precisions.
func (x *Float) Format(format byte, prec int) string {
const extra = 10 // TODO(gri) determine a good/better value here
return string(x.Append(make([]byte, 0, prec+extra), format, prec))
@@ -236,7 +236,7 @@ func (x *Float) Append(buf []byte, format byte, prec int) []byte {
// TODO(gri) factor out handling of sign?
// Inf
- if x.IsInf(0) {
+ if x.IsInf() {
var ch byte = '+'
if x.neg {
ch = '-'
@@ -261,7 +261,7 @@ func (x *Float) Append(buf []byte, format byte, prec int) []byte {
return x.bigFtoa(buf, format, prec)
}
-// BUG(gri): Currently, String uses x.Format('g', 10) rather than x.Format('g', -1).
+// BUG(gri): Float.String uses x.Format('g', 10) rather than x.Format('g', -1).
func (x *Float) String() string {
return x.Format('g', 10)
}