[Numpy-discussion] Integer type casting and OverflowError

Robert Kern robert.kern at gmail.com
Thu May 9 06:21:30 EDT 2013


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

Is this a regression in numpy, or should the code in scipy be fixed to
use a different test? Even if it is technically a regression, it might
be one of those "it's been broken so long, it's a feature now"
regressions.

--
Robert Kern



More information about the NumPy-Discussion mailing list