diff --git a/src/math/big/intconv.go b/src/math/big/intconv.go index d37d077920..0567284105 100644 --- a/src/math/big/intconv.go +++ b/src/math/big/intconv.go @@ -16,7 +16,8 @@ import ( // Base must be between 2 and 62, inclusive. The result uses the // lower-case letters 'a' to 'z' for digit values 10 to 35, and // the upper-case letters 'A' to 'Z' for digit values 36 to 61. -// No prefix (such as "0x") is added to the string. +// No prefix (such as "0x") is added to the string. If x is a nil +// pointer it returns "". func (x *Int) Text(base int) string { if x == nil { return "" @@ -33,6 +34,8 @@ func (x *Int) Append(buf []byte, base int) []byte { return append(buf, x.abs.itoa(x.neg, base)...) } +// String returns the decimal representation of x as generated by +// x.Text(10). func (x *Int) String() string { return x.Text(10) }