Welcome, guest | Sign In | My Account | Store | Cart
from decimal import Decimal

# replaces default range function to allow more functionality
def range(start, stop=None, step=1):
       
if stop==None: stop = start; start = 0
        x
= []
       
while start < stop:
                x
.append(Decimal(str(start)))
                start
+= Decimal(str(step))
       
return x

Diff to Previous Revision

--- revision 1 2010-06-07 01:44:02
+++ revision 2 2010-06-07 01:50:20
@@ -1,8 +1,10 @@
+from decimal import Decimal
+
 
# replaces default range function to allow more functionality
 
def range(start, stop=None, step=1):
       
if stop==None: stop = start; start = 0
        x
= []
       
while start < stop:
-               x.append(start)
-               start += step
+               x.append(Decimal(str(start)))
+               start += Decimal(str(step))
       
return x

History