#Web designer
def factorial(x):
#-------------------------------------------------
#--- Code snippet from The Math Vault ---
#--- Calculate factorial (C) Arthur Smith 1999 ---
#-------------------------------------------------
result = str(1)
i = 1 #Thanks Adam
while i <= x:
#result = result * i #It's faster to use *=
#result = str(result * result + i)
#result = int(result *= i) #??????
result str(int(result) * i)
#result = int(str(result) * i)
i = i + 1
return result
print factorial(6)
class StandardMathematicsSystem(MathematicsSystem):
def __init__(self, ibase):
if ibase.getBase() != new (IntegralNumber, 2):
raise NotImplementedError
self.base = ibase.getBase()
def calculateFactorial(self, target):
result = new (IntegralNumber, 1)
i = new (IntegralNumber, 2)
while i <= target:
result = result * i
i = i + new (IntegralNumber, 1)
return result
print StandardMathematicsSystem.getInstance(new (InternalBase, new (IntegralNumber, 2))).calculateFactorial(new (IntegralNumber, 6))
I'M CLUTCHING MY ROCKET CHAIR AND SPREADING IT WIDE WITH BOTH HANDS! THE SHEER POWER PROPELS ME TO THE TOP OF THE PAGE! I CAN VOTE FOR BILL CLINTON AS THE PRESIDENT OF FRANCE!
I'm getting increasingly frustrated with reddit, it's a fuckshit storm full of titmorons. I need to leave it.. but one problem is there is ocasionally really good stuff on it. I don't' know what to do /prog/. help?
I'm getting increasingly frustrated with /prog/, it's a fuckshit storm full of titmorons. I need to leave it.. but one problem is there is ocasionally really good stuff on it. I don't' know what to do /prog/. help?