[Scipy-svn] r6278 - trunk/scipy/fftpack/tests

scipy-svn@scip... scipy-svn@scip...
Mon Mar 29 20:57:07 CDT 2010


Author: cdavid
Date: 2010-03-29 20:57:06 -0500 (Mon, 29 Mar 2010)
New Revision: 6278

Modified:
   trunk/scipy/fftpack/tests/test_basic.py
Log:
PY3K: fix fftpack tests for py3k.

Modified: trunk/scipy/fftpack/tests/test_basic.py
===================================================================
--- trunk/scipy/fftpack/tests/test_basic.py	2010-03-30 01:56:59 UTC (rev 6277)
+++ trunk/scipy/fftpack/tests/test_basic.py	2010-03-30 01:57:06 UTC (rev 6278)
@@ -64,7 +64,7 @@
     n = len(x)
     w = -arange(n)*(2j*pi/n)
     r = zeros(n,dtype=double)
-    for i in range(n/2+1):
+    for i in range(int(n/2+1)):
         y = dot(exp(i*w),x)
         if i:
             r[2*i-1] = y.real
@@ -78,7 +78,7 @@
     x = asarray(x)
     n = len(x)
     x1 = zeros(n,dtype=cdouble)
-    for i in range(n/2+1):
+    for i in range(int(n/2+1)):
         if i:
             if 2*i<n:
                 x1[i] = x[2*i-1] + 1j* x[2*i]
@@ -235,7 +235,7 @@
             y1 = zeros((n,),dtype=double)
             y1[0] = y2[0].real
             y1[-1] = y2[n/2].real
-            for k in range(1,n/2):
+            for k in range(1, int(n/2)):
                 y1[2*k-1] = y2[k].real
                 y1[2*k] = y2[k].imag
             y = fftpack.drfft(x)
@@ -277,7 +277,7 @@
             x = range(n)
             x1 = zeros((n,),dtype=cdouble)
             x1[0] = x[0]
-            for k in range(1,n/2):
+            for k in range(1, int(n/2)):
                 x1[k] = x[2*k-1]+1j*x[2*k]
                 x1[n-k] = x[2*k-1]-1j*x[2*k]
             x1[n/2] = x[-1]



More information about the Scipy-svn mailing list