[Numpy-discussion] Comparing the precision of dtypes?

Hans Meine meine at informatik.uni-hamburg.de
Wed Jul 22 08:14:42 EDT 2009


Hi,

Ullrich Köthe found an interesting way to compute a promoted dtype, given two 
arrays a and b:

 type = min(float32, a.dtype.type, b.dtype.type)

How hackish is this?  Is this likely to break on other platforms/numpy 
versions?  Is there a better API for type promotion?

Have a nice day,
  Hans




More information about the NumPy-Discussion mailing list