[Python-bugs-list] [ python-Bugs-576593 ] pyport.h INFINITY and HUGE_VAL treatment

noreply@sourceforge.net noreply@sourceforge.net
Tue, 02 Jul 2002 20:32:49 -0700


Bugs item #576593, was opened at 2002-07-02 16:45
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=576593&group_id=5470

Category: Python Interpreter Core
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Jack Jansen (jackjansen)
Assigned to: Tim Peters (tim_one)
Summary: pyport.h INFINITY and HUGE_VAL treatment

Initial Comment:
pyport.h prefers to use INFINITY over HUGE_VAL, if it is available. However, for a future version of Mac OS X math.h may include both constants, but with INFINITY being a value (1e50) that will be represented as IEEE Infinity if stuffed into a float, while HUGE_VAL has the same role for a double (1e500).

The path supplied is a simple hack to undefine INFINITY for the Apple gcc compiler (which, to my knowledge, has always had a correct value for HUGE_VAL), but discussion on python-dev hinted that it may be better to get rid of all references to INFINITY here altogether, and in stead use a configure-based define of Py_HUGE_VAL in pyconfig.h on platforms where HUGE_VAL is broken. I agree with this, as long as I don't have to write the configure mods:-)

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-07-02 23:32

Message:
Logged In: YES 
user_id=31435

I instead checked in the threatened change to get rid of the 
INFINITY hack altogether.  That was there specifically to 
support some unknown subset of Cray boxes, which don't 
conform to the C standard.  People on those platforms (if 
there are any anymore ...) will have to fix this with some 
Cray-specific config hack.  I'll reject any patch that tries to 
make this the core's problem again (as you discovered, all 
that does in the end is create other problems on other 
boxes -- but do note that Jaguar has a non-conforming 
definition for INFINITY).

Include/pyport.h; new revision: 2.51
Misc/NEWS; new revision: 1.436

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=576593&group_id=5470