This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author landry
Recipients landry, mark.dickinson, rpointel, vstinner
Date 2011-07-22.15:47:48
SpamBayes Score 4.768408e-13
Marked as misclassified No
Message-id <1311349669.8.0.460277592039.issue12589@psf.upfronthosting.co.za>
In-reply-to
Content
Py_IS_INFINITY is defined as

#ifndef Py_IS_INFINITY
#  if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1
#    define Py_IS_INFINITY(X) isinf(X)
#  else
#    define Py_IS_INFINITY(X) ((X) &&                                   \
                               (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X)))
#  endif
#endif


The test still fails when built --with-pydebug.

(gdb)  b isinf 
Function "isinf" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (isinf) pending.
(gdb) r
Starting program: /usr/obj/ports/Python-3.2.1/Python-3.2.1/python 
Breakpoint 2 at 0x852786d4: file /usr/src/lib/libc/gen/isinf.c, line 27.
Pending breakpoint "isinf" resolved
Python 3.2.1 (default, Jul 22 2011, 17:34:54) 
[GCC 4.2.1 20070719 ] on openbsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> int(float('inf'))
0
[56408 refs]

isinf is #defined in math.h to

#define isinf(x) \
        ((sizeof (x) == sizeof (float)) ? \
                __isinff(x) \
        : (sizeof (x) == sizeof (double)) ? \
                __isinf(x) \
        :       __isinfl(x))

but setting a bkp on it changes nothing.

Starting program: /usr/obj/ports/Python-3.2.1/Python-3.2.1/python 
Breakpoint 2 at 0x89b4f708: file /usr/src/lib/libc/gen/isinf.c, line 36.
Pending breakpoint "__isinff" resolved
Python 3.2.1 (default, Jul 22 2011, 17:34:54) 
[GCC 4.2.1 20070719 ] on openbsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> int(float('inf'))
0

Setting a bkp on PyLong_FromDouble() shows that it's not called.

Sorry, this doesnt make sense to me...
History
Date User Action Args
2011-07-22 15:47:49landrysetrecipients: + landry, mark.dickinson, vstinner, rpointel
2011-07-22 15:47:49landrysetmessageid: <1311349669.8.0.460277592039.issue12589@psf.upfronthosting.co.za>
2011-07-22 15:47:49landrylinkissue12589 messages
2011-07-22 15:47:48landrycreate