Answer the question
In order to leave comments, you need to log in
Where is the error in the code, in the same functions?
There is code here
codepen.io/michenusweb/pen/rjrWpp
There are two identical functions here: Why does one work and the other doesn't?
Answer the question
In order to leave comments, you need to log in
productFib = (prod) ->
[a, b] = [0, 1]
[a, b] = [b, a+b] while a*b < prod
[a, b, a*b==prod]
console.log productFib 4895
productFid = (plod) ->
[c, d] = [0, 1]
[c, d] = [d, c+d] while c*d < plod
[c, d, c*d==plod]
console.log productFid 4895
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question