Skip to content

Create ModularExponentiation.java#5091

Closed
lulunac27a wants to merge 7 commits intoTheAlgorithms:masterfrom
lulunac27a:patch-1
Closed

Create ModularExponentiation.java#5091
lulunac27a wants to merge 7 commits intoTheAlgorithms:masterfrom
lulunac27a:patch-1

Conversation

@lulunac27a
Copy link
Copy Markdown

Add modular exponentiation in Java

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

Add modular exponentiation in Java
Copy link
Copy Markdown
Member

@vil02 vil02 left a comment

Choose a reason for hiding this comment

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

Please:

I also think that this could be a generic, to handle ints and longs.

Further more, what do you think about renaming it to modPow - this seems to be a more standard name in this context.

@lulunac27a
Copy link
Copy Markdown
Author

Add tests and code if y (power) is 0, return 1

@vil02
Copy link
Copy Markdown
Member

vil02 commented Apr 2, 2024

I think you also want to throw an exception for y < 0.

@vil02
Copy link
Copy Markdown
Member

vil02 commented Apr 3, 2024

@lulunac27a please fix all of the errors from the CI and please have a look at my previous comment.

@lulunac27a
Copy link
Copy Markdown
Author

Fixed errors by formatting code and changing function name to modPow

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 5, 2024

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

@github-actions github-actions bot added the stale label May 5, 2024
@github-actions
Copy link
Copy Markdown

Please reopen this pull request once you have made the required changes. If you need help, feel free to ask in our Discord server or ping one of the maintainers here. Thank you for your contribution!

@github-actions github-actions bot closed this May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants