[Numpy-discussion] Can numpy catch this error for me?

Nathaniel Peterson nathanielpeterson08 at gmail.com
Tue Apr 7 16:27:05 EDT 2009


Thanks for the quick response.
In http://www.scipy.org/Cookbook/Indexing
I see

>>> a = C[1,2,3]
>>> a
23
>>> type(a)
<type 'numpy.int32'>
>>> type(int(a))
<type 'int'>
>>> a**a
Warning: overflow encountered in long_scalars
-1276351769
>>> int(a)**int(a)
20880467999847912034355032910567L

This shows numpy can catch an overflow generated by a**a.
Why is it that numpy can catch this overflow,
but can not catch one generated by np.multiply.reduce?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090407/26aa653d/attachment.html>


More information about the NumPy-Discussion mailing list