A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-April/110958.html below:

[Python-Dev] PyObject_RichCompareBool identity shortcut

[Python-Dev] PyObject_RichCompareBool identity shortcut [Python-Dev] PyObject_RichCompareBool identity shortcutIsaac Morland ijmorlan at uwaterloo.ca
Wed Apr 27 18:40:04 CEST 2011
On Wed, 27 Apr 2011, Antoine Pitrou wrote:

> Isaac Morland <ijmorlan at uwaterloo.ca> wrote:
>>
>> Python could also provide IEEE-754 equality as a function (perhaps in
>> "math"), something like:
>>
>> def ieee_equal (a, b):
>>  	return a == b and not isnan (a) and not isnan (b)
>
> +1 (perhaps call it math.eq()).

Alexander Belopolsky pointed out to me (thanks!) that isnan is implemented 
in C so my caveat about the implementation of isnan is not an issue.  But 
then that made me realize the ieee_equal (or just "eq" if that's 
preferable) probably ought to be implemented in C using a floating point 
comparison - i.e., use the processor implementation of the comparison 
operation..

Isaac Morland			CSCF Web Guru
DC 2554C, x36650		WWW Software Specialist
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4