Skip to content

gh-100428: Make float documentation more accurate #100437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 24, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -657,11 +657,14 @@ are always available. They are listed here in alphabetical order.
sign: "+" | "-"
infinity: "Infinity" | "inf"
nan: "nan"
numeric_value: `floatnumber` | `infinity` | `nan`
number: floatnumber [`exponent`]
floatnumber: [`digitpart`] "." `digitpart` | `digitpart` ["."]
digitpart: `digit` (["_"] `digit`)*
exponent: ("e" | "E") ["+" | "-"] `digitpart`
numeric_value: `number` | `infinity` | `nan`
numeric_string: [`sign`] `numeric_value`

Here ``floatnumber`` is the form of a Python floating-point literal,
described in :ref:`floating`. Case is not significant, so, for example,
Case is not significant, so, for example,
"inf", "Inf", "INFINITY", and "iNfINity" are all acceptable spellings for
positive infinity.

Expand Down