[Numpy-discussion] What type should / return in python 3k whenapplied to two integer types?
Alan G Isaac
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 : x = ones(1, dtype=int16)
> In : true_divide(x,x)
> Out: 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?)
More information about the NumPy-Discussion