[Numpy-discussion] Comparing the precision of dtypes?

Hans Meine meine@informatik.uni-hamburg...
Wed Jul 22 07:14:42 CDT 2009


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,

More information about the NumPy-Discussion mailing list