[Numpy-discussion] isinf raises in inf
Charles R Harris
Thu Jul 15 20:33:07 CDT 2010
On Thu, Jul 15, 2010 at 7:09 PM, Charles R Harris <firstname.lastname@example.org
> On Thu, Jul 15, 2010 at 6:55 PM, Charles R Harris <
> email@example.com> wrote:
>> On Thu, Jul 15, 2010 at 6:42 PM, John Hunter <firstname.lastname@example.org> wrote:
>>> On Thu, Jul 15, 2010 at 7:27 PM, Charles R Harris
>>> <email@example.com> wrote:
>>> > On Thu, Jul 15, 2010 at 6:11 PM, John Hunter <firstname.lastname@example.org>
>>> >> On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing <email@example.com>
>>> >> > Is it certain that the Solaris compiler lacks isinf? Is it possible
>>> >> > that it has it, but it is not being detected?
>>> >> Just to clarify, I'm not using the sun compiler, but gcc-3.4.3 on
>>> >> x86
>>> > Might be related to this thread. What version of numpy are you using?
>>> svn HEAD (2.0.0.dev8480)
>>> After reading the thread you suggested, I tried forcing the
>>> flag to be set, but this is apparently a bad idea for my platform...
>>> line 5, in ?
>>> import multiarray
>>> ImportError: ld.so.1: python: fatal: relocation error: file
>>> symbol isfinite: referenced symbol not found
>>> so while I think my bug is related to that thread, I don't see
>>> anything in that thread to help me fix my problem. Or am I missing
>> In the thread there is a way to check if isinf is in the library. You can
>> also grep through the python include files where its presence should be set,
>> that's in /usr/include/python2.6/pyconfig.h on my system. If it's present,
>> then you should be able to apply David's fix<http://projects.scipy.org/numpy/changeset/8455>which amount to just a few lines.
> PS, of course we should fix the macro also. Since the bit values of +/-
> infinity are known we should be able to define them as constants using a
> couple of ifdefs and unions. I believe SUN has quad precision so we might
> need to check the layout, but the usual case seems to be zero mantissa,
> maximum exponent, and the sign. Not a number differs in that the mantissa is
> non-zero. I believe there are two versions of nans, signaling and
> non-signaling, but in any case it doesn't look to me like it should be
> impossible to simply have all those values as numpy constants like pi and e.
And here are some functions stolen from
They have have an oldstyle BSD type license which need quoting.
if ((-1.0 < x) && (x < 1.0)) /* x is small, and thus finite */
else if ((x + x) == x) /* only true if x == Infinity */
else /* must be finite (normal or subnormal), or NaN */
/* (x != x) should be sufficient, but some compilers incorrectly
optimize it away */
return (store(&x) != store(&x));
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion