diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-11-21 07:03:38 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-11-21 07:03:38 +0000 |
commit | fabcaa8df3d6eb852b87821ef090d31d222870b7 (patch) | |
tree | 72455aea0286937aa08cc141e5efc800e4626577 /libgo/go/fmt | |
parent | a51fb17f48428e7cfc96a72a9f9f87901363bb6b (diff) | |
download | gcc-fabcaa8df3d6eb852b87821ef090d31d222870b7.zip gcc-fabcaa8df3d6eb852b87821ef090d31d222870b7.tar.gz gcc-fabcaa8df3d6eb852b87821ef090d31d222870b7.tar.bz2 |
libgo: Update to current version of master library.
From-SVN: r193688
Diffstat (limited to 'libgo/go/fmt')
-rw-r--r-- | libgo/go/fmt/doc.go | 14 | ||||
-rw-r--r-- | libgo/go/fmt/print.go | 2 | ||||
-rw-r--r-- | libgo/go/fmt/scan.go | 6 |
3 files changed, 13 insertions, 9 deletions
diff --git a/libgo/go/fmt/doc.go b/libgo/go/fmt/doc.go index a9b9c9d..ff947b6 100644 --- a/libgo/go/fmt/doc.go +++ b/libgo/go/fmt/doc.go @@ -31,8 +31,8 @@ %X base 16, with upper-case letters for A-F %U Unicode format: U+1234; same as "U+%04X" Floating-point and complex constituents: - %b decimalless scientific notation with exponent a power of two, - in the manner of strconv.FormatFloat with the 'b' format, + %b decimalless scientific notation with exponent a power of two, + in the manner of strconv.FormatFloat with the 'b' format, e.g. -123456p-78 %e scientific notation, e.g. -1234.456e+78 %E scientific notation, e.g. -1234.456E+78 @@ -56,9 +56,12 @@ character '*', causing their values to be obtained from the next operand, which must be of type int. - For numeric values, width sets the width of the field and precision - sets the number of places after the decimal, if appropriate. For - example, the format %6.2f prints 123.45. + For numeric values, width sets the minimum width of the field and + precision sets the number of places after the decimal, if appropriate, + except that for %g/%G it sets the total number of digits. For example, + given 123.45 the format %6.2f prints 123.45 while %.4g prints 123.5. + The default precision for %e and %f is 6; for %g it is the smallest + number of digits necessary to identify the value uniquely. For strings, width is the minimum number of characters to output, padding with spaces if necessary, and precision is the maximum @@ -152,6 +155,7 @@ %T is not implemented %e %E %f %F %g %G are all equivalent and scan any floating point or complex value %s and %v on strings scan a space-delimited token + Flags # and + are not implemented. The familiar base-setting prefixes 0 (octal) and 0x (hexadecimal) are accepted when scanning integers without a diff --git a/libgo/go/fmt/print.go b/libgo/go/fmt/print.go index 13e5873..dce46d8 100644 --- a/libgo/go/fmt/print.go +++ b/libgo/go/fmt/print.go @@ -231,7 +231,7 @@ func Sprintf(format string, a ...interface{}) string { return s } -// Errorf formats according to a format specifier and returns the string +// Errorf formats according to a format specifier and returns the string // as a value that satisfies error. func Errorf(format string, a ...interface{}) error { return errors.New(Sprintf(format, a...)) diff --git a/libgo/go/fmt/scan.go b/libgo/go/fmt/scan.go index d69911c..62de3a2 100644 --- a/libgo/go/fmt/scan.go +++ b/libgo/go/fmt/scan.go @@ -33,8 +33,8 @@ type ScanState interface { ReadRune() (r rune, size int, err error) // UnreadRune causes the next call to ReadRune to return the same rune. UnreadRune() error - // SkipSpace skips space in the input. Newlines are treated as space - // unless the scan operation is Scanln, Fscanln or Sscanln, in which case + // SkipSpace skips space in the input. Newlines are treated as space + // unless the scan operation is Scanln, Fscanln or Sscanln, in which case // a newline is treated as EOF. SkipSpace() // Token skips space in the input if skipSpace is true, then returns the @@ -312,7 +312,7 @@ func notSpace(r rune) bool { return !isSpace(r) } -// skipSpace provides Scan() methods the ability to skip space and newline characters +// skipSpace provides Scan() methods the ability to skip space and newline characters // in keeping with the current scanning mode set by format strings and Scan()/Scanln(). func (s *ss) SkipSpace() { s.skipSpace(false) |