[Numpy-discussion] isinf raises in inf

Eric Firing efiring@hawaii....
Thu Jul 15 18:14:21 CDT 2010


On 07/15/2010 11:45 AM, Pauli Virtanen wrote:
> Thu, 15 Jul 2010 09:54:12 -0500, John Hunter wrote:
> [clip]
>> In [4]: np.isinf(x)
>> Warning: invalid value encountered in isinf Out[4]: True
>
> As far as I know, isinf has always created NaNs -- since 2006 it has been
> defined on "unsupported" platforms as
>
> 	(!isnan((x))&&  isnan((x)-(x)))
>
> I'll replace it by the obvious
>
> 	((x) == NPY_INFINITY || (x) == -NPY_INFINITY)
>
> which is true only for +-inf, and cannot raise any FPU exceptions.
>

Is it certain that the Solaris compiler lacks isinf?  Is it possible 
that it has it, but it is not being detected?

Eric


More information about the NumPy-Discussion mailing list