Skip to content

Commit

Permalink
[3.12] pythongh-114070: correct the specification of digit in the…
Browse files Browse the repository at this point in the history
… float() docs (pythonGH-114080) (python#114094)

pythongh-114070: correct the specification of ``digit`` in the float() docs (pythonGH-114080)
(cherry picked from commit 4f24b92)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
  • Loading branch information
miss-islington and skirpichev authored Jan 15, 2024
1 parent 41a94c9 commit f6315ed
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -668,16 +668,15 @@ are always available. They are listed here in alphabetical order.
sign: "+" | "-"
infinity: "Infinity" | "inf"
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` ["."]
exponent: ("e" | "E") ["+" | "-"] `digitpart`
floatnumber: number [`exponent`]
floatvalue: [`sign`] (`floatnumber` | `infinity` | `nan`)

Here ``digit`` is a Unicode decimal digit (character in the Unicode general
category ``Nd``). Case is not significant, so, for example, "inf", "Inf",
"INFINITY", and "iNfINity" are all acceptable spellings for positive
infinity.
Case is not significant, so, for example, "inf", "Inf", "INFINITY", and
"iNfINity" are all acceptable spellings for positive infinity.

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
Expand Down

0 comments on commit f6315ed

Please sign in to comment.