Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix, Docs, Test: Fibonacci_fast (Renamed to Fibonacci_iterative) #2614

Closed

Conversation

Renjian-buchai
Copy link
Contributor

@Renjian-buchai Renjian-buchai commented Oct 9, 2023

Description of Change

The original algorithm does not calculate the nth fibonacci number, but rather the next fibonacci number after storing it in a static variable. Thus, I abstracted the looping part out of the code that you have to write upon application, into the function itself.

The "Test" in main does not really test anything, rather demonstrates what it does. Added actual unit tests with test cases.

The "Test" in main also does not calculate the nth fibonacci number, but rather the (n+1)th fibonacci number.

The maximum value that can be computed such that the result is less than UINT64_MAX is also incorrect because of the above error.

The file brief did not explain what it actually does properly.

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • I acknowledge that all my contributions will be made under the project's license.

Notes:
Fixed bugs, added documentation, and unit tests for Fibonacci_fast (Renamed to Fibonacci_iterative to better reflect what it actually does).

For #2456.

(Sorry for long extended commit message)
The original algorithm does not calculate the nth fibonacci number, but rather the
next fibonacci number after storing it in a static variable. Thus, I abstracted the
looping part out of the code that you have to write upon application, into the
function itself.

The function also does not calculate the nth fibonacci number, but rather the
(n+1)th fibonacci number.

The "Test" in main does not really test anything, rather demonstrates what it does.
Added actual unit tests with test cases.

The file brief did not explain what it actually does properly.
@Renjian-buchai
Copy link
Contributor Author

I genuinely don't know what the original author was trying to do here, tbh.

math/fibonacci_iterative.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Author has not responded to the comments for over 2 weeks label Nov 15, 2023
Copy link
Collaborator

@realstealthninja realstealthninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@realstealthninja
Copy link
Collaborator

@Panquesito7 could we get this merged?

@realstealthninja realstealthninja added dont-close This issue/pull request shouldn't be closed and removed stale Author has not responded to the comments for over 2 weeks labels Mar 17, 2024
@Renjian-buchai Renjian-buchai closed this by deleting the head repository May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dont-close This issue/pull request shouldn't be closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants