[Numpy-discussion] Integer type casting and OverflowError

Robert Kern robert.kern at gmail.com
Thu May 9 06:45:19 EDT 2013


On Thu, May 9, 2013 at 11:38 AM, Scott Sinclair
<scott.sinclair.za at gmail.com> wrote:
> On 9 May 2013 12:21, Robert Kern <robert.kern at gmail.com> wrote:
>> With master numpy (and back to 1.6.1, at least):
>>
>> [~]
>> |1> np.int32(3054212286)
>> -1240755010
>>
>>
>> It seems like at one time, this used to raise an OverflowError. We can
>> see this in at least one place in scipy:
>>
>> https://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack.py#L912
>
> No doubt I'm missing something, but isn't the OverflowError raised
> here https://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack.py#L40
> and not in Numpy?

Heh. I wrote this email before I submitted the PR with that fix. :-)

Here is what the code used to look like:

https://github.com/scipy/scipy/blob/c1625b2cd026553cc9414ad12bb90c74a469e714/scipy/interpolate/fitpack.py#L912

--
Robert Kern



More information about the NumPy-Discussion mailing list