Skip to content

Commit

Permalink
[3.11] gh-114070: correct the specification of digit in the float…
Browse files Browse the repository at this point in the history
…() docs (GH-114080) (#114095)

gh-114070: correct the specification of ``digit`` in the float() docs (GH-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 3a181a1 commit 76433f8
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
@@ -667,16 +667,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

0 comments on commit 76433f8

Please sign in to comment.