challenge-algorithms-v2.0-g.../04-fibonacci/index.js

7 lines
185 B
JavaScript

export function fibonacci(value) {
// implementar logica aqui
let phi = (1 + Math.sqrt(5))/2;
let asymp = Math.pow(phi, value) / Math.sqrt(5);
return Math.round(asymp);
}