[Numpy-discussion] What type should / return in python 3k whenapplied to two integer types?

Alan G Isaac aisaac@american....
Thu Aug 27 14:12:01 CDT 2009

Charles R Harris wrote:
> The real problem is deciding what to do with integer precisions that fit 
> in float32.  At present we have
> In [2]: x = ones(1, dtype=int16)
> In [3]: true_divide(x,x)
> Out[3]: array([ 1.], dtype=float32)

A user perspective:
ambiguous cases should always be
resolved to the default (float64).
Users that know what they are doing
can always request another dtype.

(Well at least in principle; currently
ufuncs not allow a dtype argument I
guess. Is there a reason not to make
the `out` argument a keyword argument
and then also alternatively allow
a dtype specification?)

Alan Isaac

More information about the NumPy-Discussion mailing list