[SciPy-user] IBM float point format...
Wed Jan 14 16:24:42 CST 2009
> python complains that operand >> is not supported on numpy.float32 and
> int (which I understand quite well for float32):
> 2 """ Converts an IBM floating point number into IEEE
> format. """
> ----> 4 sign = ibm >> 31 & 0x01
> 6 exponent = ibm >> 24 & 0x7f
> TypeError: unsupported operand type(s) for >>: 'numpy.float32' and
> What am I doing wrong ?
I presume you are to read in the data from disk as an int32, which
then gets processed to a float by Robert's code.
The ufunc operates in the same way -- look at its signature.
More information about the SciPy-user