update snippets 32-47

This commit is contained in:
Stefan Feješ
2017-12-25 14:10:38 +01:00
parent 1835d4894d
commit 7b9ec970e2
15 changed files with 65 additions and 20 deletions

View File

@ -7,5 +7,8 @@ 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
```
```js
fibonacciCountUntilNum(10) -> 7
```