From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 16 Mar 2023 20:43:03 +0000 (-0700) Subject: [3.10] Fix outdated note about 'int' rounding or truncating (GH-102736) (#102767) X-Git-Tag: v3.10.11~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99b38bebfd92ed8b1c83799345cb6d9120bdf31c;p=thirdparty%2FPython%2Fcpython.git [3.10] Fix outdated note about 'int' rounding or truncating (GH-102736) (#102767) Fix outdated note about 'int' rounding or truncating (GH-102736) (cherry picked from commit 405739f9166592104a5b0b945de92e28415ae972) Co-authored-by: Mark Dickinson --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 59d64457edcd..6752c475ad7f 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -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 "+"