diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-03-05 21:43:22 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-03-27 18:42:34 -0600 |
commit | 91aa03f4a1065319e85c6ee90306971c301fd58c (patch) | |
tree | c4d40c32610eccebb71ad1f52c4f389c0d1b86b0 /numpy/core/machar.py | |
parent | 1a816c79f7212102634c28e0896547671d347a60 (diff) | |
download | numpy-91aa03f4a1065319e85c6ee90306971c301fd58c.tar.gz |
2to3: Replace xrange by range and use list(range(...)) where needed
In python3 range is an iterator and `xrange` has been removed. This has
two consequence for code:
1) Where a list is needed `list(range(...))` must be used.
2) `xrange` must be replaced by `range`
Both of these changes also work in python2 and this patch makes both.
There are three places fixed that do not need it, but I left them in
so that the result would be `xrange` clean.
Closes #3092
Diffstat (limited to 'numpy/core/machar.py')
-rw-r--r-- | numpy/core/machar.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/core/machar.py b/numpy/core/machar.py index b7e64290e..d44d17499 100644 --- a/numpy/core/machar.py +++ b/numpy/core/machar.py @@ -123,7 +123,7 @@ class MachAr(object): # Do we really need to do this? Aren't they 2 and 2.0? # Determine ibeta and beta a = one - for _ in xrange(max_iterN): + for _ in range(max_iterN): a = a + a temp = a + one temp1 = temp - a @@ -132,7 +132,7 @@ class MachAr(object): else: raise RuntimeError(msg % (_, one.dtype)) b = one - for _ in xrange(max_iterN): + for _ in range(max_iterN): b = b + b temp = a + b itemp = int_conv(temp-a) @@ -146,7 +146,7 @@ class MachAr(object): # Determine it and irnd it = -1 b = one - for _ in xrange(max_iterN): + for _ in range(max_iterN): it = it + 1 b = b * beta temp = b + one @@ -158,7 +158,7 @@ class MachAr(object): betah = beta / two a = one - for _ in xrange(max_iterN): + for _ in range(max_iterN): a = a + a temp = a + one temp1 = temp - a @@ -182,7 +182,7 @@ class MachAr(object): for i in range(negep): a = a * betain b = a - for _ in xrange(max_iterN): + for _ in range(max_iterN): temp = one - a if any(temp-one != zero): break @@ -201,7 +201,7 @@ class MachAr(object): machep = - it - 3 a = b - for _ in xrange(max_iterN): + for _ in range(max_iterN): temp = one + a if any(temp-one != zero): break @@ -223,7 +223,7 @@ class MachAr(object): z = betain t = one + eps nxres = 0 - for _ in xrange(max_iterN): + for _ in range(max_iterN): y = z z = y*y a = z*one # Check here for underflow @@ -249,7 +249,7 @@ class MachAr(object): mx = iz + iz - 1 # Determine minexp and xmin - for _ in xrange(max_iterN): + for _ in range(max_iterN): xmin = y y = y * betain a = y * one |