Re: [Numpy-discussion] Int casting different across platforms

2011-11-05 Thread Matthew Brett
Hi, On Sun, Nov 6, 2011 at 2:39 AM, Charles R Harris wrote: > > > On Sat, Nov 5, 2011 at 7:35 PM, Nathaniel Smith wrote: >> >> On Sat, Nov 5, 2011 at 4:07 PM, Matthew Brett >> wrote: >> > Intel, gcc: >> > 4, -2147483648 >> > PPC, gcc: >> > 4, 2147483647 >> > >> > I think that's what you predict

Re: [Numpy-discussion] Int casting different across platforms

2011-11-05 Thread Charles R Harris
On Sat, Nov 5, 2011 at 7:35 PM, Nathaniel Smith wrote: > On Sat, Nov 5, 2011 at 4:07 PM, Matthew Brett > wrote: > > Intel, gcc: > > 4, -2147483648 > > PPC, gcc: > > 4, 2147483647 > > > > I think that's what you predicted. Is it strange that the same > > compiler gives different results? > > > >

Re: [Numpy-discussion] Int casting different across platforms

2011-11-05 Thread Nathaniel Smith
On Sat, Nov 5, 2011 at 4:07 PM, Matthew Brett wrote: > Intel, gcc: > 4, -2147483648 > PPC, gcc: > 4, 2147483647 > > I think that's what you predicted.  Is it strange that the same > compiler gives different results? > > It would be good if the behavior was the same across platforms - the > unexpec

Re: [Numpy-discussion] Int casting different across platforms

2011-11-05 Thread Matthew Brett
Hi, On Sat, Nov 5, 2011 at 6:24 PM, Charles R Harris wrote: > > > On Fri, Nov 4, 2011 at 5:21 PM, Matthew Brett > wrote: >> >> Hi, >> >> I noticed this: >> >> (Intel Mac): >> >> In [2]: np.int32(np.float32(2**31)) >> Out[2]: -2147483648 >> >> (PPC): >> >> In [3]: np.int32(np.float32(2**31)) >> O

Re: [Numpy-discussion] Int casting different across platforms

2011-11-05 Thread Charles R Harris
On Fri, Nov 4, 2011 at 5:21 PM, Matthew Brett wrote: > Hi, > > I noticed this: > > (Intel Mac): > > In [2]: np.int32(np.float32(2**31)) > Out[2]: -2147483648 > > (PPC): > > In [3]: np.int32(np.float32(2**31)) > Out[3]: 2147483647 > > I assume what is happening is that the casting is handing off to

[Numpy-discussion] Int casting different across platforms

2011-11-04 Thread Matthew Brett
Hi, I noticed this: (Intel Mac): In [2]: np.int32(np.float32(2**31)) Out[2]: -2147483648 (PPC): In [3]: np.int32(np.float32(2**31)) Out[3]: 2147483647 I assume what is happening is that the casting is handing off to the c library, and that behavior of the c library differs on these platforms?