Topic: Calculating phi ≈ 1.61803398874
I want to make a function to calculate phi (approximately equal to 1.61803398874 (i think))
i have already tried and came up with this but it doesn't work:
def phi():
def fib(n):
a,d,b=0,0,1
while d<=n:
c=a+b
a=b
b=c
d+=1
return float(c)
e=1
while True:
print(long(fib(e)/fib(e-1))*10**(10+e))
e+=1
raw_input()
phi()
i need help
Last edited by gillett.hernandez (November 13, 2011 07:45)