mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
[3.12] gh-114070: correct the specification of `digit
` in the float() docs (GH-114080) (#114094)
gh-114070: correct the specification of ``digit`` in the float() docs (GH-114080)
(cherry picked from commit 4f24b92aa0
)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
This commit is contained in:
parent
41a94c9e7b
commit
f6315edca1
1 changed files with 4 additions and 5 deletions
|
@ -668,16 +668,15 @@ are always available. They are listed here in alphabetical order.
|
||||||
sign: "+" | "-"
|
sign: "+" | "-"
|
||||||
infinity: "Infinity" | "inf"
|
infinity: "Infinity" | "inf"
|
||||||
nan: "nan"
|
nan: "nan"
|
||||||
digitpart: `!digit` (["_"] `!digit`)*
|
digit: <a Unicode decimal digit, i.e. characters in Unicode general category Nd>
|
||||||
|
digitpart: `digit` (["_"] `digit`)*
|
||||||
number: [`digitpart`] "." `digitpart` | `digitpart` ["."]
|
number: [`digitpart`] "." `digitpart` | `digitpart` ["."]
|
||||||
exponent: ("e" | "E") ["+" | "-"] `digitpart`
|
exponent: ("e" | "E") ["+" | "-"] `digitpart`
|
||||||
floatnumber: number [`exponent`]
|
floatnumber: number [`exponent`]
|
||||||
floatvalue: [`sign`] (`floatnumber` | `infinity` | `nan`)
|
floatvalue: [`sign`] (`floatnumber` | `infinity` | `nan`)
|
||||||
|
|
||||||
Here ``digit`` is a Unicode decimal digit (character in the Unicode general
|
Case is not significant, so, for example, "inf", "Inf", "INFINITY", and
|
||||||
category ``Nd``). Case is not significant, so, for example, "inf", "Inf",
|
"iNfINity" are all acceptable spellings for positive infinity.
|
||||||
"INFINITY", and "iNfINity" are all acceptable spellings for positive
|
|
||||||
infinity.
|
|
||||||
|
|
||||||
Otherwise, if the argument is an integer or a floating point number, a
|
Otherwise, if the argument is an integer or a floating point number, a
|
||||||
floating point number with the same value (within Python's floating point
|
floating point number with the same value (within Python's floating point
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue