Skip to content

Commit

Permalink
[3.10] Fix outdated note about 'int' rounding or truncating (GH-102736)…
Browse files Browse the repository at this point in the history
… (#102767)

Fix outdated note about 'int' rounding or truncating (GH-102736)
(cherry picked from commit 405739f)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
  • Loading branch information
miss-islington and mdickinson authored Mar 16, 2023
1 parent 9781240 commit 99b38be
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,10 @@ Notes:
single: ceil() (in module math)
single: trunc() (in module math)
pair: numeric; conversions
pair: C; language

Conversion from floating point to integer may round or truncate
as in C; see functions :func:`math.floor` and :func:`math.ceil` for
well-defined conversions.
Conversion from :class:`float` to :class:`int` truncates, discarding the
fractional part. See functions :func:`math.floor` and :func:`math.ceil` for
alternative conversions.

(4)
float also accepts the strings "nan" and "inf" with an optional prefix "+"
Expand Down

0 comments on commit 99b38be

Please sign in to comment.