[Python-ideas] Floating point "closeness" Proposal Outline

Ethan Furman ethan at stoneleaf.us
Wed Jan 21 00:27:03 CET 2015


On 01/20/2015 09:32 AM, Chris Barker wrote:
> On Mon, Jan 19, 2015 at 8:10 PM, Neil Girdhar wrote:
> 
>> If you decide to make a PEP, please list the other algorithms you found and their definitions. 
> 
> sure -- care to contribute ;-)

>> Personally, I'm for being consistent with numpy and defining math.isclose similar to numpy.isclose for consistency
>> alone.
> 
> This is a good question for the larger, non-numpy group. I'm personally a heavy numpy user, and don't see any reason to
> be consistent -- and I (and others on this list) have some real issues with the numpy approach. But we shouldn't call it
> isclose() if it's not the same algorithm...

I'm not a numpy nor heavy maths user, and see no reason why we should try to match numpy -- if you want/need numpy, get
numpy.

There is also no reason to not use the same name, even if it is not the same algorithm -- if the answer we're looking
for is "is it close?" then is_close is a fine name (or isclose, similar to the other is... functions and methods Python
already has).

I think for simplicity' sake, a symmetric function would be better.

--
~Ethan~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150120/307c2df6/attachment.sig>


More information about the Python-ideas mailing list