Skip to content

feat: implement Fibonacci, Primality Test, and Newton's Square Root algorithms#156

Open
raza-khan0108 wants to merge 1 commit intomanrajgrover:masterfrom
raza-khan0108:feat/math-algorithms
Open

feat: implement Fibonacci, Primality Test, and Newton's Square Root algorithms#156
raza-khan0108 wants to merge 1 commit intomanrajgrover:masterfrom
raza-khan0108:feat/math-algorithms

Conversation

@raza-khan0108
Copy link
Copy Markdown

Description of new feature, or changes

This PR implements three additional mathematical algorithms from the math checklist in issue #110. The following functions have been added to src/algorithms/math/:

  1. Fibonacci Sequence: An iterative implementation to generate the first n numbers.
  2. Primality Test: An optimized trial division algorithm (checking up to $\sqrt{n}$) to determine if a number is prime.
  3. Newton's Square Root: A calculation using Newton's method (Babylonian method) for high-precision square roots.

Checklist

  • Your branch is up-to-date with the base branch
  • You've included at least one test if this is a new feature
  • All tests are passing

Related Issues and Discussions

Fixes #110

People to notify

@manrajgrover

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant