On Wednesday 22 July 2009 17:16:31 Ralf Gommers wrote: > 2009/7/22 Hans Meine <me...@informatik.uni-hamburg.de> > > type = min(float32, a.dtype.type, b.dtype.type) > > Are you looking for the type to cast to? In that case I guess you meant > max() not min().
No, at least for integers min(..) does what one would expect max(..) to do. But... > > How hackish is this? Is this likely to break on other platforms/numpy > > versions? Is there a better API for type promotion? > > That could give unexpected results. Useful functions are find_common_type, ..find_common_type() is exactly what we were looking for; thanks a lot for the pointer! Have a nice day, Hans _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion