Commit e28a3929 authored by Matthew Dempsky's avatar Matthew Dempsky

math/big: cleanup documentation for Format methods

'b' is a standard verb for floating point values. The runes like '+'
and '#' are called "flags" by package fmt's documentation. The flag
'-' controls left/right justification, not anything related to signs.

Change-Id: Ia9cf81b002df373f274ce635fe09b5bd0066aa1c
Reviewed-on: https://go-review.googlesource.com/20930Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 36d5650a
...@@ -374,12 +374,11 @@ func min(x, y int) int { ...@@ -374,12 +374,11 @@ func min(x, y int) int {
} }
// Format implements fmt.Formatter. It accepts all the regular // Format implements fmt.Formatter. It accepts all the regular
// formats for floating-point numbers ('e', 'E', 'f', 'F', 'g', // formats for floating-point numbers ('b', 'e', 'E', 'f', 'F',
// 'G') as well as 'b', 'p', and 'v'. See (*Float).Text for the // 'g', 'G') as well as 'p' and 'v'. See (*Float).Text for the
// interpretation of 'b' and 'p'. The 'v' format is handled like // interpretation of 'p'. The 'v' format is handled like 'g'.
// 'g'.
// Format also supports specification of the minimum precision // Format also supports specification of the minimum precision
// in digits, the output field width, as well as the format verbs // in digits, the output field width, as well as the format flags
// '+' and ' ' for sign control, '0' for space or zero padding, // '+' and ' ' for sign control, '0' for space or zero padding,
// and '-' for left or right justification. See the fmt package // and '-' for left or right justification. See the fmt package
// for details. // for details.
......
...@@ -52,16 +52,16 @@ func writeMultiple(s fmt.State, text string, count int) { ...@@ -52,16 +52,16 @@ func writeMultiple(s fmt.State, text string, count int) {
} }
} }
// Format is a support routine for fmt.Formatter. It accepts // Format implements fmt.Formatter. It accepts the formats
// the formats 'b' (binary), 'o' (octal), 'd' (decimal), 'x' // 'b' (binary), 'o' (octal), 'd' (decimal), 'x' (lowercase
// (lowercase hexadecimal), and 'X' (uppercase hexadecimal). // hexadecimal), and 'X' (uppercase hexadecimal).
// Also supported are the full suite of package fmt's format // Also supported are the full suite of package fmt's format
// verbs for integral types, including '+', '-', and ' ' // flags for integral types, including '+' and ' ' for sign
// for sign control, '#' for leading zero in octal and for // control, '#' for leading zero in octal and for hexadecimal,
// hexadecimal, a leading "0x" or "0X" for "%#x" and "%#X" // a leading "0x" or "0X" for "%#x" and "%#X" respectively,
// respectively, specification of minimum digits precision, // specification of minimum digits precision, output field
// output field width, space or zero padding, and left or // width, space or zero padding, and '-' for left or right
// right justification. // justification.
// //
func (x *Int) Format(s fmt.State, ch rune) { func (x *Int) Format(s fmt.State, ch rune) {
// determine base // determine base
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment