mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #19543: Implementation of isclose as per PEP 485
For details, see: PEP 0485 -- A Function for testing approximate equality Functions added: math.isclose() and cmath.isclose(). Original code by Chris Barker. Patch by Tal Einat. (merge 3.5)
This commit is contained in:
commit
bc8db8fa1b
9 changed files with 450 additions and 1 deletions
|
@ -285,6 +285,18 @@ rather than being restricted to ASCII.
|
|||
|
||||
:pep:`488` -- Multi-phase extension module initialization
|
||||
|
||||
PEP 485: A function for testing approximate equality
|
||||
----------------------------------------------------
|
||||
|
||||
:pep:`485` adds the :func:`math.isclose` and :func:`cmath.isclose`
|
||||
functions which tell whether two values are approximately equal or
|
||||
"close" to each other. Whether or not two values are considered
|
||||
close is determined according to given absolute and relative tolerances.
|
||||
|
||||
.. seealso::
|
||||
|
||||
:pep:`485` -- A function for testing approximate equality
|
||||
|
||||
Other Language Changes
|
||||
======================
|
||||
|
||||
|
@ -346,6 +358,13 @@ cgi
|
|||
* :class:`~cgi.FieldStorage` now supports the context management protocol.
|
||||
(Contributed by Berker Peksag in :issue:`20289`.)
|
||||
|
||||
cmath
|
||||
-----
|
||||
|
||||
* :func:`cmath.isclose` function added.
|
||||
(Contributed by Chris Barker and Tal Einat in :issue:`24270`.)
|
||||
|
||||
|
||||
code
|
||||
----
|
||||
|
||||
|
@ -578,6 +597,8 @@ math
|
|||
|
||||
* :data:`math.inf` and :data:`math.nan` constants added. (Contributed by Mark
|
||||
Dickinson in :issue:`23185`.)
|
||||
* :func:`math.isclose` function added.
|
||||
(Contributed by Chris Barker and Tal Einat in :issue:`24270`.)
|
||||
|
||||
shutil
|
||||
------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue