From a847d935591492524034eae0d1311afe89eacc07 Mon Sep 17 00:00:00 2001 From: Gabriel Gomes Date: Mon, 31 Oct 2022 13:50:56 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20Adiciona=20o=20c=C3=B3digo=20do=20desaf?= =?UTF-8?q?io=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04-fibonacci/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..be20017 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,4 +1,7 @@ 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); } \ No newline at end of file