[Numpy-svn] r3639 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Sun Apr 1 18:22:18 CDT 2007


Author: oliphant
Date: 2007-04-01 18:22:15 -0500 (Sun, 01 Apr 2007)
New Revision: 3639

Modified:
   trunk/numpy/core/src/arrayobject.c
Log:
Do not use floating-point numbers to copy data as it will not work when high-order bits are set that do not fit in the floating-point representation.

Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2007-04-01 23:06:02 UTC (rev 3638)
+++ trunk/numpy/core/src/arrayobject.c	2007-04-01 23:22:15 UTC (rev 3639)
@@ -324,7 +324,7 @@
 
         switch(elsize) {
         case 8:
-                _FAST_MOVE(Float64);
+                _FAST_MOVE(Int64);
         case 4:
                 _FAST_MOVE(Int32);
         case 1:
@@ -333,8 +333,8 @@
                 _FAST_MOVE(Int16);
         case 16:
                 for (i=0; i<N; i++) {
-                        ((Float64 *)tout)[0] = ((Float64 *)tin)[0];
-                        ((Float64 *)tout)[1] = ((Float64 *)tin)[1];
+                        ((Int64 *)tout)[0] = ((Int64 *)tin)[0];
+                        ((Int64 *)tout)[1] = ((Int64 *)tin)[1];
                         tin += instrides;
                         tout += outstrides;
                 }



More information about the Numpy-svn mailing list