Long integer arrays in Python; how? /Carl

Carl phleum_nospam at chello.se
Mon Nov 28 16:04:45 EST 2005


I have the following problem 

    import Numeric
    dim = 1
    bits = 32
    v = Numeric.zeros((dim, bits), 'l')
    for j in range(bits):
        v[0][j] = 1L << bits - j - 1

The problem is the last assignment, which is not valid, since the integer is
on the right hand side is to large to be assigned to an array element.

Is there a way around this problem in Python?

Yours /Carl



More information about the Python-list mailing list