update snippets 32-47
This commit is contained in:
committed by
Agamemnon Zorbas
parent
014a77224c
commit
1c73c70b4a
@ -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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user