[Numpy-discussion] uint64 typecasting with scalars broken (?)
Charles R Harris
charlesr.harris@gmail....
Sun Apr 22 18:28:58 CDT 2007
On 4/22/07, Christian Marquardt <christian@marquardt.sc> wrote:
>
> Hello,
>
> The following is what I expected...
>
> >>> y = 1234
> >>> x = array([1], dtype = "uint64")
> >>> print x + y, (x + y).dtype.type
> [1235] <type 'numpy.uint64'>
>
> but is this the way it should be? (numpy 1.0.2, Linux, Intel comilers)
>
> >>> print x[0] + y, type(x[0] + y)
> 1235.0 <type 'numpy.float64'>
Looks like a bug to me:
In [5]: x = array([1],dtype=uint64)
In [6]: type(x[0])
Out[6]: <type 'numpy.uint64'>
In [7]: type(x[0]+1)
Out[7]: <type 'numpy.float64'>
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070422/b8d2463b/attachment.html
More information about the Numpy-discussion
mailing list