[Numpy-discussion] Trace returns int32 type for int8 array.
Charles R Harris
Wed Aug 29 11:59:22 CDT 2007
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...
More information about the Numpy-discussion