Update fibsTillNum.md
This commit is contained in:
@ -5,5 +5,5 @@ Returns the number of fibonnacci numbers till num(0 and num inclusive)
|
|||||||
```js
|
```js
|
||||||
const fibsTillNum = num =>
|
const fibsTillNum = num =>
|
||||||
Math.ceil(Math.log(num * Math.sqrt(5) + 1/2) / Math.log((Math.sqrt(5)+1)/2))// fibonacci(5) -> [0,1,1,2,3]
|
Math.ceil(Math.log(num * Math.sqrt(5) + 1/2) / Math.log((Math.sqrt(5)+1)/2))// fibonacci(5) -> [0,1,1,2,3]
|
||||||
\\ fibsTillNum(10) -> 7
|
// fibsTillNum(10) -> 7
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user