Installed python-numeric 17.1.2-1 (all source i386)

Christopher C. Chimelis chris at
Fri Dec 1 18:58:50 CST 2000

Doh, found a problem and am still trying to figure out what the best way
to fix it is.  In Src/arrayobject.c, starting at around line 70:

int do_sliced_copy(char *dest, int *dest_strides, int *dest_dimensions,
                   int dest_nd, char *src, int *src_strides,
                   int *src_dimensions, int src_nd, int elsize,
                   int copies) {
        int i, j;               

        if (src_nd == 0 && dest_nd == 0) {
            switch(elsize) {
            case sizeof(char):
                memset(dest, *src, copies);
            case sizeof(short):
                for(j=copies; j; --j, dest += sizeof(short))
                    *(short*)dest = *(short*)src;               
            case sizeof(long):
                for(j=copies; j; --j, dest += sizeof(int))
                    *(int*)dest = *(int*)src;
            case sizeof(double):
                for(j=copies; j; --j, dest += sizeof(double))
                    *(double*)dest = *(double*)src;
                for(j=copies; j; --j, dest += elsize)
                    memcpy(dest, src, elsize);
            return 0;

The problem is, that sizeof(long) = sizeof(double) on Alpha (and probably
on the other 64-bit archs).  So, what do you think the best method of
handling this is?

I don't know the package well anymore or else I'd fix it :-P


More information about the Numpy-discussion mailing list