]> Cypherpunks repositories - gostls13.git/commitdiff
fmt: document that Scan etc. accept 'p' format floats
authorAlberto Donizetti <alb.donizetti@gmail.com>
Mon, 16 Apr 2018 11:35:35 +0000 (13:35 +0200)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Tue, 17 Apr 2018 07:38:28 +0000 (07:38 +0000)
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 <r@golang.org>
src/fmt/doc.go

index f3f2023dc2116bc124d7841785bb14315342f686..a8fc4e0c74aa36b9e5651b5242ee17b4b31b4911 100644 (file)
        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