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

7 lines
185 B
JavaScript
Raw Normal View History

export function fibonacci(value) {
// implementar logica aqui
2022-10-31 16:50:56 +00:00
let phi = (1 + Math.sqrt(5))/2;
let asymp = Math.pow(phi, value) / Math.sqrt(5);
return Math.round(asymp);
}