From 9bff50575e8bf5bf84ade26f737ffa47379b4604 Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Mon, 16 Apr 2018 13:35:35 +0200 Subject: [PATCH] fmt: document that Scan etc. accept 'p' format floats In the Scan functions documentation, clarify that for float/complex literals in scientific notation both decimal (e) and binary (p) exponents are accepted. Fixes #24453 Change-Id: Ic6dcdb0c36e088ffb65177038aff7a57ab56b805 Reviewed-on: https://go-review.googlesource.com/107416 Reviewed-by: Rob Pike --- src/fmt/doc.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fmt/doc.go b/src/fmt/doc.go index f3f2023dc2..a8fc4e0c74 100644 --- a/src/fmt/doc.go +++ b/src/fmt/doc.go @@ -281,9 +281,11 @@ The verbs behave analogously to those of Printf. For example, %x will scan an integer as a hexadecimal number, and %v will scan the default representation format for the value. - The Printf verbs %p and %T and the flags # and + are not implemented, - and the verbs %e %E %f %F %g and %G are all equivalent and scan any - floating-point or complex value. + The Printf verbs %p and %T and the flags # and + are not implemented. + The verbs %e %E %f %F %g and %G are all equivalent and scan any + floating-point or complex value. For float and complex literals in + scientific notation, both the decimal (e) and binary (p) exponent + formats are supported (for example: "2.3e+7" and "4.5p-8"). Input processed by verbs is implicitly space-delimited: the implementation of every verb except %c starts by discarding