[Numpy-svn] r3612 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Thu Mar 29 13:23:15 CDT 2007


Author: oliphant
Date: 2007-03-29 13:23:11 -0500 (Thu, 29 Mar 2007)
New Revision: 3612

Modified:
   trunk/numpy/lib/index_tricks.py
Log:
Fix mgrid inconsistency ticket #467

Modified: trunk/numpy/lib/index_tricks.py
===================================================================
--- trunk/numpy/lib/index_tricks.py	2007-03-28 23:59:15 UTC (rev 3611)
+++ trunk/numpy/lib/index_tricks.py	2007-03-29 18:23:11 UTC (rev 3612)
@@ -10,6 +10,7 @@
 import sys
 import numpy.core.numeric as _nx
 from numpy.core.numeric import asarray, ScalarType, array
+import math
 
 import function_base
 import numpy.core.defmatrix as matrix
@@ -141,7 +142,7 @@
                     size.append(int(abs(step)))
                     typ = float
                 else:
-                    size.append(int((key[k].stop - start)/(step*1.0)))
+                    size.append(math.ceil((key[k].stop - start)/(step*1.0)))
                 if isinstance(step, float) or \
                     isinstance(start, float) or \
                     isinstance(key[k].stop, float):



More information about the Numpy-svn mailing list