mirror of
https://github.com/golang/go
synced 2024-11-18 11:24:41 -07:00
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 <r@golang.org>
This commit is contained in:
parent
155aefe0c1
commit
9bff50575e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user