[Numpy-discussion] Operations on integer matrices known to return integers

Six Silberman silberman.six@gmail....
Tue Jul 10 15:52:45 CDT 2012

We now have

>>> a = array([[1, 2], [3, 4]], dtype=int8)
array([[1, 2],
           [3, 4]], dtype=int8)

>>> d = linalg.det(a)

>>> d

>>> d.dtype

This is at least partly due to use of LU factorization in computing
the determinant.

Some operations on integer matrices always return integers. It
occurred to me that it might be nice to be able to ask functions
performing such operations to always return an integer.

We could do

>>> print d

but this seems a little unfortunate.

If this has been discussed many times previously and you just groaned
inwardly, or if this is simply outside the scope of numpy, please let
me know and I'll move along.

Thanks very much,


More information about the NumPy-Discussion mailing list