timeline corrected; fitter corrected
--HG-- branch : aspn
This commit is contained in:
22
src/frange.py
Normal file
22
src/frange.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# http://code.activestate.com/recipes/66472/
|
||||||
|
|
||||||
|
def frange(start, end=None, inc=None):
|
||||||
|
"A range function, that does accept float increments..."
|
||||||
|
|
||||||
|
if end == None:
|
||||||
|
end = start + 0.0
|
||||||
|
start = 0.0
|
||||||
|
|
||||||
|
if inc == None:
|
||||||
|
inc = 1.0
|
||||||
|
|
||||||
|
L = []
|
||||||
|
while 1:
|
||||||
|
next = start + len(L) * inc
|
||||||
|
if inc > 0 and next >= end:
|
||||||
|
break
|
||||||
|
elif inc < 0 and next <= end:
|
||||||
|
break
|
||||||
|
L.append(next)
|
||||||
|
|
||||||
|
return L
|
||||||
Reference in New Issue
Block a user