[Numpy-discussion] Trace returns int32 type for int8 array.

Charles R Harris charlesr.harris at gmail.com
Wed Aug 29 12:59:22 EDT 2007

Hi all,

The documentation of trace says it returns the same type as the array. Yet:

>>> trace(eye(2, dtype=int8)).dtype

For float types this promotion does not occur

>>> trace(eye(2, dtype=float32)).dtype

Trace operates the same way as sum. What should be the case here? And if
type promotion is the default, shouldn't float32 be promoted to double?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070829/1126a868/attachment.html>

More information about the NumPy-Discussion mailing list