Re: [Numpy-discussion] isinf raises in inf

2010-07-16 Thread Charles R Harris
On Fri, Jul 16, 2010 at 2:27 AM, Pauli Virtanen wrote: > Thu, 15 Jul 2010 19:09:15 -0600, Charles R Harris wrote: > [clip] > > 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

Re: [Numpy-discussion] isinf raises in inf

2010-07-16 Thread Pauli Virtanen
Thu, 15 Jul 2010 19:09:15 -0600, Charles R Harris wrote: [clip] > 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. We already do that, NPY_INFINITY and -NPY_INFINITY. [

Re: [Numpy-discussion] isinf raises in inf

2010-07-16 Thread Pauli Virtanen
Testing with arithmetic can raise overflows and underflows. I think the correct isinf is to compare to NPY_INFINITY and -NPY_INFINITY. Patch is attached to #1500 - Alkuperäinen viesti - > On Thu, Jul 15, 2010 at 6:42 PM, John Hunter wrote: > > > On Thu, Jul 15, 2010 at 7:27 PM, Charles

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread Charles R Harris
On Thu, Jul 15, 2010 at 6:42 PM, John Hunter wrote: > On Thu, Jul 15, 2010 at 7:27 PM, Charles R Harris > wrote: > > > > > > On Thu, Jul 15, 2010 at 6:11 PM, John Hunter wrote: > >> > >> On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing > wrote: > >> > Is it certain that the Solaris compiler lacks

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread Charles R Harris
On Thu, Jul 15, 2010 at 7:09 PM, Charles R Harris wrote: > > > On Thu, Jul 15, 2010 at 6:55 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Thu, Jul 15, 2010 at 6:42 PM, John Hunter wrote: >> >>> On Thu, Jul 15, 2010 at 7:27 PM, Charles R Harris >>> wrote: >>> > >>> > >

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread Charles R Harris
On Thu, Jul 15, 2010 at 6:55 PM, Charles R Harris wrote: > > > On Thu, Jul 15, 2010 at 6:42 PM, John Hunter wrote: > >> On Thu, Jul 15, 2010 at 7:27 PM, Charles R Harris >> wrote: >> > >> > >> > On Thu, Jul 15, 2010 at 6:11 PM, John Hunter wrote: >> >> >> >> On Thu, Jul 15, 2010 at 6:14 PM, Er

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread Charles R Harris
On Thu, Jul 15, 2010 at 6:42 PM, John Hunter wrote: > On Thu, Jul 15, 2010 at 7:27 PM, Charles R Harris > wrote: > > > > > > On Thu, Jul 15, 2010 at 6:11 PM, John Hunter wrote: > >> > >> On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing > wrote: > >> > Is it certain that the Solaris compiler lacks

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread John Hunter
On Thu, Jul 15, 2010 at 7:27 PM, Charles R Harris wrote: > > > On Thu, Jul 15, 2010 at 6:11 PM, John Hunter wrote: >> >> On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing wrote: >> > Is it certain that the Solaris compiler lacks isinf?  Is it possible >> > that it has it, but it is not being detected

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread Charles R Harris
On Thu, Jul 15, 2010 at 6:11 PM, John Hunter wrote: > On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing wrote: > > 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

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread John Hunter
On Thu, Jul 15, 2010 at 7:11 PM, John Hunter wrote: > On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing wrote: >> 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

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread John Hunter
On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing wrote: > 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 solaris x86 ___

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread Eric Firing
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" pl

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread Pauli Virtanen
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'l

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread Eric Firing
On 07/15/2010 04:54 AM, John Hunter wrote: > I am seeing a problem on Solaris since I upgraded to svn HEAD. > np.isinf does not handle np.inf. See ipython session below. I am not > seeing this problem w/ HEAD on an ubuntu linux box I tested on > > In [1]: import numpy as np > > In [2]: np.__versi

[Numpy-discussion] isinf raises in inf

2010-07-15 Thread John Hunter
I am seeing a problem on Solaris since I upgraded to svn HEAD. np.isinf does not handle np.inf. See ipython session below. I am not seeing this problem w/ HEAD on an ubuntu linux box I tested on In [1]: import numpy as np In [2]: np.__version__ Out[2]: '2.0.0.dev8480' In [3]: x = np.inf np.inf