[Python-Dev] PEP 485: math.isclose()

Chris Barker chris.barker at noaa.gov
Mon May 25 06:53:17 CEST 2015

I don't think I have permissions to comment on the issue,so I'm posting
here. If there is a way for me to post to the issue, someone let me know...

In the issue (http://bugs.python.org/issue24270) Tal wrote

I have a question regarding complex values. The code (from Chris Barker)
doesn't support complex values (only things that can be converted into
doubles). However, the PEP states the following under "Non-float types":

"complex : for complex, the absolute value of the complex values will be
used for scaling and comparison. If a complex tolerance is passed in, the
absolute value will be used as the tolerance."

right -- that was written before it was decided that isclose() needed to be
written in C -- the python version supported that.

Should math.isclose() support complex values?
nope -- the math module is all about floats.

Should an equivalent function be added to cmath?

I think so -- lets see if we can do that in time for 3.5 -- but first get
the float one done.

 Should we just leave things as they are and remove mention of complex
values from the PEP (it isn't mentioned in the docs)?
I'll update the PEP.



Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150524/0efd2570/attachment.html>

More information about the Python-Dev mailing list