update snippets 32-47

This commit is contained in:
Stefan Feješ
2017-12-25 14:10:38 +01:00
committed by Agamemnon Zorbas
parent 014a77224c
commit 1c73c70b4a
16 changed files with 71 additions and 27 deletions

View File

@ -6,6 +6,9 @@ Use a mathematical formula to calculate the number of fibonacci numbers until `n
```js
const fibonacciCountUntilNum = num =>
Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2));
// fibonacciCountUntilNum(10) -> 7
Math.ceil(Math.log(num * Math.sqrt(5) + 1/2) / Math.log((Math.sqrt(5)+1)/2));
```
```js
fibonacciCountUntilNum(10) -> 7
```