Skip to content

Fibonacci.js overhaul #1049

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

Merged
merged 25 commits into from
Jun 27, 2022
Merged

Fibonacci.js overhaul #1049

merged 25 commits into from
Jun 27, 2022

Conversation

Rudxain
Copy link
Contributor

@Rudxain Rudxain commented Jun 21, 2022

Added BigInt support to FibonacciMatrixExpo, Identity, matrixMultiply, and matrixExpo. And added the extension to negative domain for all fns in that file. And added a generator function example. Also corrected indices to return 0 if the input arg is 0 (because that's the 0th Fib).
Fixes: #1047

Open in Gitpod know more

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new JavaScript files are placed inside an existing directory.
  • All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames.
    Example:UserProfile.js is allowed but userprofile.js,Userprofile.js,user-Profile.js,userProfile.js are not
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

Rudxain added 2 commits June 21, 2022 13:35
Also added support to `Identity`, `matrixMultiply`, and `matrixExpo`
@appgurueu appgurueu added feature Adds a new feature algorithm Adds or improves an algorithm labels Jun 21, 2022
@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 1 alert when merging 33df079 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Useless comparison test

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 1 alert when merging f4f1d53 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Useless comparison test

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 1 alert when merging 2bcbc58 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Useless comparison test

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 1 alert when merging 3d865f3 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Useless comparison test

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 1 alert when merging 0dc81a8 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Useless comparison test

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 1 alert when merging 1f61f51 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Useless comparison test

@Rudxain Rudxain changed the title Added BigInt support to FibonacciMatrixExpo Add BigInt support to FibonacciMatrixExpo and negatives for the entire Fibonacci.js Jun 21, 2022
@Rudxain Rudxain changed the title Add BigInt support to FibonacciMatrixExpo and negatives for the entire Fibonacci.js Add BigInt & negative support to Fibonacci.js Jun 21, 2022
@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 1 alert when merging b2101fc into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Useless comparison test

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 1 alert when merging c5fe0b5 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Useless comparison test

This wasn't originally part of the PR, but I thought it would be good to add
@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 3 alerts when merging 787fd75 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Expression has no effect
  • 1 for Assignment to property of primitive value
  • 1 for Useless comparison test

@Rudxain Rudxain changed the title Add BigInt & negative support to Fibonacci.js Add BigInt & negative support to Fibonacci.js, also generator fn Jun 21, 2022
@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 3 alerts when merging 028ebe9 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Expression has no effect
  • 1 for Assignment to property of primitive value
  • 1 for Useless comparison test

@Rudxain Rudxain changed the title Add BigInt & negative support to Fibonacci.js, also generator fn Fibonacci.js overhaul Jun 21, 2022
@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 3 alerts when merging 69bbe51 into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Expression has no effect
  • 1 for Assignment to property of primitive value
  • 1 for Useless comparison test

@Rudxain
Copy link
Contributor Author

Rudxain commented Jun 21, 2022

  • 1 for Assignment to property of primitive value

lol, the bot can't recognize the destructuring assignment syntax

My bad, I didn't recognize that the array literal was interpreted as subscript, lol

@lgtm-com
Copy link

lgtm-com bot commented Jun 21, 2022

This pull request introduces 3 alerts when merging 82861ef into 95a8ec0 - view on LGTM.com

new alerts:

  • 1 for Expression has no effect
  • 1 for Assignment to property of primitive value
  • 1 for Useless comparison test

@Rudxain
Copy link
Contributor Author

Rudxain commented Jun 21, 2022

I tried removing the trailing whitespace, but somehow I can't find them. It seems those are control chars.
Update: Not even VScode can find them. I activated control char rendering and whitespace rendering, no results. I clicked the "Remove all trailing whitespace" option, but absolutely nothing changed. This seems to be a bug

@Rudxain Rudxain marked this pull request as ready for review June 21, 2022 20:37
@raklaptudirm
Copy link
Member

Use standard.js to style your code and remove trailing whitespace. Make sure to read CONTRIBUTING.md before making any contributions.

@raklaptudirm raklaptudirm added the code style issue Failing style checks label Jun 22, 2022
@Rudxain
Copy link
Contributor Author

Rudxain commented Jun 22, 2022

Make sure to read CONTRIBUTING.md

I already did it, many times, and thoroughly. I just prefer to fix style errors manually. But it seems the only solution now is to use SJS. I'll install NPM & Node now

@Rudxain
Copy link
Contributor Author

Rudxain commented Jun 22, 2022

Wait, now I read the problem is in Fibonacci.test.js, not Fibonacci.js 🤦‍♂️. Fixing now

@raklaptudirm raklaptudirm removed the code style issue Failing style checks label Jun 22, 2022
raklaptudirm
raklaptudirm previously approved these changes Jun 26, 2022
appgurueu
appgurueu previously approved these changes Jun 26, 2022
Copy link
Collaborator

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Definitely a significant improvement. I've got some minor comments regarding consistency.

@Rudxain Rudxain dismissed stale reviews from appgurueu and raklaptudirm via 21ff3fd June 26, 2022 18:01
@raklaptudirm raklaptudirm merged commit 1b64ba6 into TheAlgorithms:master Jun 27, 2022
@Rudxain Rudxain deleted the patch-2 branch June 27, 2022 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
algorithm Adds or improves an algorithm feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fibonacci Matrix doesn't use BigInts
3 participants