Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix: Multiple errors in fibonacci search. #2659
Conversation
|
I think we are done here. Are not we? |
| """ | ||
| >>> fibonacci_search([1,6,7,0,0,0], 6) | ||
| if not isinstance(k, int): | ||
| raise ValueError("k must be an integer.") |
dhruvmanila
Oct 6, 2020
Member
| raise ValueError("k must be an integer.") | |
| raise TypeError("k must be an integer.") |
As the user entered the wrong type.
| return -1 | ||
| n = len(arr) | ||
| # Find m such that F_m >= n where F_i is the i_th fibonacci number. | ||
| m = next(x for x in range(sys.maxsize ** 10) if fibonacci(x) >= n) |
dhruvmanila
Oct 6, 2020
Member
sys.maxsize is already a huge number. Can you tell me why is this necessary?
And please use descriptive variable names instead of the single letter names as mentioned in CONTRIBUTING.md. Apply the changes wherever the variables were used.


Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.