[SciPy-dev] signbit and -inf

Darren Dale dd55 at cornell.edu
Wed Oct 19 14:28:58 EDT 2005


Hi Travis,

On Wednesday 19 October 2005 1:53 pm, Travis Oliphant wrote:
> Darren Dale wrote:
> >>I can run the full test without a segfault, although I am only using the
> >>newcore (I get a segfault when I install newscipy and try to import
> >> scipy). I am using Gentoo on a Pentium4, with Python-2.4.2 and
> >> gcc-3.4.4. I built scipy against BLAS/LAPACK/ATLAS using the same
> >> site.cfg as I used to build scipy-0.3.2. It turns out that on my
> >> machine, signbit returns False for any negative number, not just -inf.
> >
> >Does anyone have any suggestions as to how I can pursue this?
>
> Look at the config.h file in the scipy include directory  (under
> site-packages/scipy/base/include)

My config.h is located in site-packages/scipy/base/include/scipy:

/* #define SIZEOF_SHORT 2 */
/* #define SIZEOF_INT 4 */
/* #define SIZEOF_LONG 4 */
/* #define SIZEOF_FLOAT 4 */
/* #define SIZEOF_DOUBLE 8 */
#define SIZEOF_LONG_DOUBLE 12
#define SIZEOF_PY_INTPTR_T 4
/* #define SIZEOF_LONG_LONG 8 */
#define SIZEOF_PY_LONG_LONG 8
/* #define CHAR_BIT 8 */
#define MATHLIB m
#define HAVE_LONGDOUBLE_FUNCS
#define HAVE_FLOAT_FUNCS
#define HAVE_INVERSE_HYPERBOLIC
#define HAVE_INVERSE_HYPERBOLIC_FLOAT
#define HAVE_INVERSE_HYPERBOLIC_LONGDOUBLE
#define HAVE_ISNAN

> The important questions are
>
> is WORDS_BIGENDIAN defined in pyconfig.h (in include/pythonX.X) and what
> is the SIZEOF integer on your platform.
>
> For your system, I would expect SIZEOF_INT to be 4 (look in config.h)
> and WORDS_BIGENDIAN to not be defined.

Here is the only mention of WORDS_BIGENDIAN 
in /usr/include/python2.4/pyconfig.h

/* Define to 1 if your processor stores words with the most significant byte
   first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */

Darren




More information about the SciPy-Dev mailing list