[Numpy-discussion] Unexpected casting result

Warren Weckesser warren.weckesser at gmail.com
Mon Sep 16 14:26:15 EDT 2013


On Mon, Sep 16, 2013 at 1:54 PM, Warren Weckesser <
warren.weckesser at gmail.com> wrote:

> An unexpected casting result was just reported on stackoverflow:
>
> http://stackoverflow.com/questions/18833639/attributeerror-in-python-numpy-when-constructing-function-for-certain-values
>
> The following show the essence of the issue:
>
> In [1]: np.__version__
> Out[1]: '1.9.0.dev-6ce65d8'
>
> In [2]: type(np.array(1.) * (2**64-1))
> Out[2]: numpy.float64
>
> In [3]: type(np.array(1.) * (2**64))
> Out[3]: float
>
> Note that the result of `np.array(1.0) * 2**64` is a Python float, not a
> numpy float64.  Is this intentional?
>
> (As pointed out in the stackoverflow question, the issue
> https://github.com/numpy/numpy/issues/3409 is at least tangentially
> related.)
>
> Warren
>
>


The original poster of the stackoverflow question has reported the issue on
github: https://github.com/numpy/numpy/issues/3756

Warren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130916/5ec1673d/attachment.html>


More information about the NumPy-Discussion mailing list