From e28a3929efa9797530c7f74284796825a25d2011 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Sun, 20 Mar 2016 14:54:13 -0700 Subject: [PATCH] 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/20930 Reviewed-by: Brad Fitzpatrick --- src/math/big/ftoa.go | 9 ++++----- src/math/big/intconv.go | 18 +++++++++--------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/math/big/ftoa.go b/src/math/big/ftoa.go index 95c9320a24..624ea5e073 100644 --- a/src/math/big/ftoa.go +++ b/src/math/big/ftoa.go @@ -374,12 +374,11 @@ func min(x, y int) int { } // Format implements fmt.Formatter. It accepts all the regular -// formats for floating-point numbers ('e', 'E', 'f', 'F', 'g', -// 'G') as well as 'b', 'p', and 'v'. See (*Float).Text for the -// interpretation of 'b' and 'p'. The 'v' format is handled like -// 'g'. +// formats for floating-point numbers ('b', 'e', 'E', 'f', 'F', +// 'g', 'G') as well as 'p' and 'v'. See (*Float).Text for the +// interpretation of 'p'. The 'v' format is handled like 'g'. // 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 left or right justification. See the fmt package // for details. diff --git a/src/math/big/intconv.go b/src/math/big/intconv.go index 56a75f87ae..daf674aef4 100644 --- a/src/math/big/intconv.go +++ b/src/math/big/intconv.go @@ -52,16 +52,16 @@ func writeMultiple(s fmt.State, text string, count int) { } } -// Format is a support routine for fmt.Formatter. It accepts -// the formats 'b' (binary), 'o' (octal), 'd' (decimal), 'x' -// (lowercase hexadecimal), and 'X' (uppercase hexadecimal). +// Format implements fmt.Formatter. It accepts the formats +// 'b' (binary), 'o' (octal), 'd' (decimal), 'x' (lowercase +// hexadecimal), and 'X' (uppercase hexadecimal). // Also supported are the full suite of package fmt's format -// verbs for integral types, including '+', '-', and ' ' -// for sign control, '#' for leading zero in octal and for -// hexadecimal, a leading "0x" or "0X" for "%#x" and "%#X" -// respectively, specification of minimum digits precision, -// output field width, space or zero padding, and left or -// right justification. +// flags for integral types, including '+' and ' ' for sign +// control, '#' for leading zero in octal and for hexadecimal, +// a leading "0x" or "0X" for "%#x" and "%#X" respectively, +// specification of minimum digits precision, output field +// width, space or zero padding, and '-' for left or right +// justification. // func (x *Int) Format(s fmt.State, ch rune) { // determine base -- 2.48.1