64-bit / 128-bit data element type for array?
bearophileHUGS at lycos.com
bearophileHUGS at lycos.com
Mon Dec 22 14:22:02 EST 2008
akineko:
> I need to handle binary files that contain 64-bit (or 128-bit in the
> furture) unsigned int data.
> Python's array seems not supporting unsigned int type beyond 32-bit
> ('L').
I agree that it can be useful for the built-in array module to grow
signed/unsigned 64 bit numbers.
Numpy supports signed/unsigned 64 bit numbers too, so that may be
enough for you:
http://docs.scipy.org/doc/numpy/user/basics.types.html
Regarding 128-bit numbers you may have to support them manually, with
pairs of uint64, with numpy. They aren't much common yet.
(D language will have cent/ucent 128 bit integral numbers, but it's
not a common thing).
Bye,
bearophile
More information about the Python-list
mailing list