[Numpy-discussion] binary_repr dtype dependence

Stéfan van der Walt stefan at sun.ac.za
Sun Jul 13 17:35:29 EDT 2008


Hi Ralf

2008/7/13 Ralf Gommers <ralf.gommers at googlemail.com>:
> Hi all,
>
> binary_repr() behaves differently for different types of ints/uints:
>
> In [210]: binary_repr(255)
> Out[210]: '11111111'
>
> In [211]: binary_repr(uint32(255))
> Out[211]: '11111111'
>
> In [212]: binary_repr(uint16(255))
> Out[212]: '1'

That's a bug.  It happens because

In [9]: hex(np.uint16(255))
Out[9]: '0x1'

Please create a ticket.

Regards
Stéfan



More information about the NumPy-Discussion mailing list