[Numpy-discussion] numpy endian question

Stefan van der Walt stefan@sun.ac...
Fri Apr 27 07:56:40 CDT 2007


On Fri, Apr 27, 2007 at 08:49:16AM -0400, Christopher Hanley wrote:
> >> -> isBigEndian = (obj.dtype.str[0] == '>')
> >
> > Is this test always safe, even on big endian machines?  Couldn't the
> > dtype.str[0] sometimes be '='?
> >   
> The test does would on big endian machines.  What wouldn't work would be 
> something like this:
> 
> -> isBigEndian = (obj.dtype.byteorder == '>')
> 
> On a big-endian machine you would get '=' in this case.

Ah, yes, I was confused.  What I meant to ask was, couldn't
dtype.str[0] sometimes be '|'?

Cheers
Stéfan


More information about the Numpy-discussion mailing list