[pypy-commit] pypy unsigned-dtypes: fixes for promote_to_float and promote_to_largest

justinpeel noreply at buildbot.pypy.org
Fri Sep 2 01:15:12 CEST 2011


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: unsigned-dtypes
Changeset: r47003:018e3d037507
Date: 2011-09-01 17:13 -0600
http://bitbucket.org/pypy/pypy/changeset/018e3d037507/

Log:	fixes for promote_to_float and promote_to_largest

diff --git a/pypy/module/micronumpy/interp_ufuncs.py b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -206,6 +206,8 @@
     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)
@@ -214,6 +216,8 @@
             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


More information about the pypy-commit mailing list