1. Henrik Vendelbo
  2. pypy

Commits

Justin Peel  committed 018e3d0

fixes for promote_to_float and promote_to_largest

  • Participants
  • Parent commits 96b9259
  • Branches unsigned-dtypes

Comments (0)

Files changed (1)

File pypy/module/micronumpy/interp_ufuncs.py

View file
     if promote_to_float:
         if dt.kind == interp_dtype.FLOATINGLTR:
             return dt
+        if dt.num >= 5:
+            return space.fromcache(interp_dtype.W_Float64Dtype)
         for bytes, dtype in interp_dtype.dtypes_by_num_bytes:
             if dtype.kind == interp_dtype.FLOATINGLTR and dtype.num_bytes > dt.num_bytes:
                 return space.fromcache(dtype)
             return space.fromcache(interp_dtype.W_Int64Dtype)
         elif dt.kind == interp_dtype.FLOATINGLTR:
             return space.fromcache(interp_dtype.W_Float64Dtype)
+        elif dt.kind == interp_dtype.UNSIGNEDLTR:
+            return space.fromcache(interp_dtype.W_UInt64Dtype)
         else:
             assert False
     return dt