[Numpy-discussion] int16 or int32 for C int ?

Nicolas Pernetty nicopernetty at yahoo.fr
Mon Jun 27 16:50:21 CDT 2005


On Mon, 27 Jun 2005 11:27:40 +0200, Jochen Küpper
<jochen at fhi-berlin.mpg.de> wrote :


> >> On the platforms we test on at least,  int == Int32.  This is even
> >> true for the 64-bit platforms I've seen.
> 
> Didn't some Crays have 64bit ints? They definitely had 64bit float and
> 128bit double.
> 
> > Ok so If I want to make a really multiplatforms program, I should
> > type :
> >
> > int a[10][20];
> > if (sizeof(**a)==4)
> >     x = NA_NewArray(a, tInt32, 2, 10, 20);
> > else
> >     x = NA_NewArray(a, tInt16, 2, 10, 20);
> 
> Maybe you should right away include a test for 8byte as well.
> 

On this page you have some exotic 'int' :
http://www.doc.ic.ac.uk/lab/secondyear/cstyle/node20.html

The problem was no as simple as it seems to be.
I'll go with the sizeof trick and some error message if I'm dealing with
an exotic 'int'...




More information about the Numpy-discussion mailing list